Skip to content

Commit 41bfd47

Browse files
committed
Merge branch 'develop'
2 parents 119d5a5 + 89d1cea commit 41bfd47

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

dt-import/admin/dt-import-mapping.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,13 @@ public static function get_unique_column_values( $csv_data, $column_index ) {
534534
$values = [];
535535

536536
foreach ( $csv_data as $row ) {
537-
if ( isset( $row[$column_index] ) && !empty( trim( $row[$column_index] ) ) ) {
537+
if ( isset( $row[$column_index] ) && trim( $row[$column_index] ) !== '' ) {
538538
$value = trim( $row[$column_index] );
539539

540540
// For multi-value fields, split by semicolon
541541
$split_values = DT_CSV_Import_Utilities::split_multi_value( $value );
542542
foreach ( $split_values as $split_value ) {
543-
if ( !empty( $split_value ) ) {
543+
if ( trim( $split_value ) !== '' ) {
544544
$values[$split_value] = $split_value;
545545
}
546546
}

dt-import/assets/js/dt-import.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
<div class="dt-import-initial-content">
189189
<h2>Step 1: Select Record Type</h2>
190190
<p>Choose the type of records you want to import from your CSV file.</p>
191-
191+
192192
<div class="post-type-grid">
193193
<!-- Post type cards will be dynamically populated -->
194194
</div>
@@ -214,7 +214,7 @@
214214
<div class="dt-import-step-content">
215215
<h2>${window.dt_admin_shared.escape(dtImport.translations.uploadCsv)}</h2>
216216
<p>Upload a CSV file containing ${window.dt_admin_shared.escape(this.getPostTypeLabel())} data.</p>
217-
217+
218218
<div class="file-upload-section">
219219
<div class="file-upload-area">
220220
<div class="upload-icon">
@@ -226,7 +226,7 @@
226226
</div>
227227
</div>
228228
<input type="file" id="csv-file-input" accept=".csv" style="display: none;">
229-
229+
230230
<div class="file-info" style="display: none;">
231231
<div class="file-details">
232232
<h4></h4>
@@ -488,20 +488,20 @@
488488
<div class="dt-import-step-content">
489489
<h2>${window.dt_admin_shared.escape(dtImport.translations.mapFields)}</h2>
490490
<p>Map each CSV column to the appropriate field in Disciple.Tools.</p>
491-
491+
492492
<div class="name-field-warning" style="display: none;">
493493
<div class="notice notice-error">
494494
<p><strong><i class="mdi mdi-alert"></i> Name Field Required</strong></p>
495495
<p>The name field is required for all imports. Please map at least one CSV column to the name field before proceeding.</p>
496496
</div>
497497
</div>
498-
498+
499499
<div class="mapping-container">
500500
<div class="mapping-columns">
501501
${columnsHtml}
502502
</div>
503503
</div>
504-
504+
505505
<div class="mapping-summary" style="display: none;">
506506
<h3>Mapping Summary</h3>
507507
<div class="summary-stats"></div>
@@ -631,20 +631,20 @@
631631
: ''
632632
}
633633
</div>
634-
634+
635635
<div class="sample-data">
636636
<strong>Sample data:</strong>
637637
<ul>${sampleDataHtml}</ul>
638638
</div>
639-
639+
640640
<div class="mapping-controls">
641641
<label>Map to field:</label>
642642
<select class="field-mapping-select" data-column-index="${window.dt_admin_shared.escape(columnIndex)}">
643643
<option value="">-- Do not import --</option>
644644
${this.getFieldOptions(finalSelectedField)}
645645
<option value="create_new">+ Create New Field</option>
646646
</select>
647-
647+
648648
<div class="field-specific-options" style="display: none;"></div>
649649
</div>
650650
</div>
@@ -1271,7 +1271,7 @@
12711271
<div class="dt-import-step-content">
12721272
<h2>${window.dt_admin_shared.escape(dtImport.translations.previewImport)}</h2>
12731273
<p>Review the data before importing ${window.dt_admin_shared.escape(previewData.total_rows)} records.</p>
1274-
1274+
12751275
${
12761276
previewData.is_estimated
12771277
? `
@@ -1281,7 +1281,7 @@
12811281
`
12821282
: ''
12831283
}
1284-
1284+
12851285
<div class="preview-stats">
12861286
<div class="stat-card">
12871287
<h3>${window.dt_admin_shared.escape(previewData.total_rows)}</h3>
@@ -1306,15 +1306,15 @@
13061306
<p>Errors</p>
13071307
</div>
13081308
</div>
1309-
1309+
13101310
${
13111311
previewData.is_estimated
13121312
? `
13131313
<p style="font-size: 12px; color: #666; margin-top: 5px;"><em>* Estimated values based on sampling</em></p>
13141314
`
13151315
: ''
13161316
}
1317-
1317+
13181318
${
13191319
totalErrors > 0
13201320
? `
@@ -1327,7 +1327,7 @@
13271327
`
13281328
: ''
13291329
}
1330-
1330+
13311331
${
13321332
totalWarnings > 0
13331333
? `
@@ -1340,7 +1340,7 @@
13401340
`
13411341
: ''
13421342
}
1343-
1343+
13441344
<div class="preview-table-container">
13451345
${this.createPreviewTable(previewData.rows)}
13461346
</div>
@@ -1592,7 +1592,7 @@
15921592
: ''
15931593
}
15941594
</div>
1595-
1595+
15961596
${
15971597
results.imported_records &&
15981598
results.imported_records.length > 0
@@ -1629,7 +1629,7 @@
16291629
`
16301630
: ''
16311631
}
1632-
1632+
16331633
${
16341634
results.errors && results.errors.length > 0
16351635
? `
@@ -1648,7 +1648,7 @@
16481648
`
16491649
: ''
16501650
}
1651-
1651+
16521652
<div class="results-actions">
16531653
<button type="button" class="button button-primary" onclick="location.reload()">
16541654
Start New Import

dt-import/includes/dt-import-utilities.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static function get_sample_data( $csv_data, $column_index, $count = 5 ) {
8989
break;
9090
}
9191

92-
if ( isset( $row[$column_index] ) && !empty( trim( $row[$column_index] ) ) ) {
92+
if ( isset( $row[$column_index] ) && trim( $row[$column_index] ) !== '' ) {
9393
$samples[] = trim( $row[$column_index] );
9494
$row_count++;
9595
}
@@ -329,7 +329,7 @@ public static function normalize_boolean( $value ) {
329329
* Split multi-value string (semicolon separated by default)
330330
*/
331331
public static function split_multi_value( $value, $separator = ';' ) {
332-
if ( empty( $value ) ) {
332+
if ( $value === '' ) {
333333
return [];
334334
}
335335

dt-posts/posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,7 @@ public static function adjust_post_custom_fields( $post_type, int $post_id, arra
24962496
}
24972497
}
24982498
} elseif ( isset( $field_settings[$key] ) && $field_settings[$key]['type'] == 'key_select' && ( !isset( $field_settings[$key]['private'] ) || !$field_settings[$key]['private'] ) ) {
2499-
if ( empty( $value[0]['value'] ) ) {
2499+
if ( $value[0]['value'] === '' ) {
25002500
unset( $fields[$key] );
25012501
continue;
25022502
}

0 commit comments

Comments
 (0)