@@ -211,9 +211,9 @@ public function displayImport(): array
211
211
}
212
212
213
213
// check if "email" is mapped
214
+ $ error = [];
214
215
if (isset ($ stepCurrent ) && $ stepCurrent === 'startImport ' ) {
215
216
$ map = $ this ->indata ['map ' ];
216
- $ error = [];
217
217
// check noMap
218
218
$ newMap = ArrayUtility::removeArrayEntryByValue (array_unique ($ map ), 'noMap ' );
219
219
if (empty ($ newMap )) {
@@ -227,6 +227,9 @@ public function displayImport(): array
227
227
}
228
228
229
229
$ out = '' ;
230
+ if (!isset ($ stepCurrent )) {
231
+ $ stepCurrent = '' ;
232
+ }
230
233
switch ($ stepCurrent ) {
231
234
case 'conf ' :
232
235
$ output ['conf ' ]['show ' ] = true ;
@@ -269,7 +272,7 @@ public function displayImport(): array
269
272
['val ' =>'name ' , 'text ' => 'name ' ],
270
273
];
271
274
272
- $ output ['conf ' ]['disableInput ' ] = $ this ->params ['inputDisable ' ] == 1 ? true : false ;
275
+ $ output ['conf ' ]['disableInput ' ] = ( $ this ->params ['inputDisable ' ] ?? 0 ) == 1 ? true : false ;
273
276
274
277
// show configuration
275
278
$ output ['subtitle ' ] = $ this ->getLanguageService ()->getLL ('mailgroup_import_header_conf ' );
@@ -279,10 +282,10 @@ public function displayImport(): array
279
282
$ output ['conf ' ]['storageSelected ' ] = $ this ->indata ['storage ' ] ?? '' ;
280
283
281
284
// remove existing option
282
- $ output ['conf ' ]['remove_existing ' ] = !$ this ->indata ['remove_existing ' ] ? false : true ;
285
+ $ output ['conf ' ]['remove_existing ' ] = !( $ this ->indata ['remove_existing ' ] ?? false ) ? false : true ;
283
286
284
287
// first line in csv is to be ignored
285
- $ output ['conf ' ]['first_fieldname ' ] = !$ this ->indata ['first_fieldname ' ] ? false : true ;
288
+ $ output ['conf ' ]['first_fieldname ' ] = !( $ this ->indata ['first_fieldname ' ] ?? false ) ? false : true ;
286
289
287
290
// csv separator
288
291
$ output ['conf ' ]['delimiter ' ] = $ optDelimiter ;
@@ -293,13 +296,13 @@ public function displayImport(): array
293
296
$ output ['conf ' ]['encapsulationSelected ' ] = $ this ->indata ['encapsulation ' ] ?? '' ;
294
297
295
298
// import only valid email
296
- $ output ['conf ' ]['valid_email ' ] = !$ this ->indata ['valid_email ' ] ? false : true ;
299
+ $ output ['conf ' ]['valid_email ' ] = !( $ this ->indata ['valid_email ' ] ?? false ) ? false : true ;
297
300
298
301
// only import distinct records
299
- $ output ['conf ' ]['remove_dublette ' ] = !$ this ->indata ['remove_dublette ' ] ? false : true ;
302
+ $ output ['conf ' ]['remove_dublette ' ] = !( $ this ->indata ['remove_dublette ' ] ?? false ) ? false : true ;
300
303
301
304
// update the record instead renaming the new one
302
- $ output ['conf ' ]['update_unique ' ] = !$ this ->indata ['update_unique ' ] ? false : true ;
305
+ $ output ['conf ' ]['update_unique ' ] = !( $ this ->indata ['update_unique ' ] ?? false ) ? false : true ;
303
306
304
307
// which field should be use to show uniqueness of the records
305
308
$ output ['conf ' ]['record_unique ' ] = $ optUnique ;
@@ -320,7 +323,7 @@ public function displayImport(): array
320
323
$ output ['mapping ' ]['remove_dublette ' ] = $ this ->indata ['remove_dublette ' ];
321
324
$ output ['mapping ' ]['update_unique ' ] = $ this ->indata ['update_unique ' ];
322
325
$ output ['mapping ' ]['record_unique ' ] = $ this ->indata ['record_unique ' ];
323
- $ output ['mapping ' ]['all_html ' ] = !$ this ->indata ['all_html ' ] ? false : true ;
326
+ $ output ['mapping ' ]['all_html ' ] = !( $ this ->indata ['all_html ' ] ?? false ) ? false : true ;
324
327
$ output ['mapping ' ]['error ' ] = $ error ;
325
328
326
329
// show charset selector
@@ -386,7 +389,7 @@ public function displayImport(): array
386
389
$ output ['mapping ' ]['table ' ][] = [
387
390
'mapping_description ' => $ csv_firstRow [$ i ],
388
391
'mapping_i ' => $ i ,
389
- 'mapping_mappingSelected ' => $ this ->indata ['map ' ][$ i ],
392
+ 'mapping_mappingSelected ' => $ this ->indata ['map ' ][$ i ] ?? '' ,
390
393
'mapping_value ' => $ exampleLines ,
391
394
];
392
395
}
@@ -427,8 +430,8 @@ public function displayImport(): array
427
430
$ output ['startImport ' ]['remove_dublette ' ] = $ this ->indata ['remove_dublette ' ];
428
431
$ output ['startImport ' ]['update_unique ' ] = $ this ->indata ['update_unique ' ];
429
432
$ output ['startImport ' ]['record_unique ' ] = $ this ->indata ['record_unique ' ];
430
- $ output ['startImport ' ]['all_html ' ] = !$ this ->indata ['all_html ' ] ? false : true ;
431
- $ output ['startImport ' ]['add_cat ' ] = $ this ->indata ['add_cat ' ] ? true : false ;
433
+ $ output ['startImport ' ]['all_html ' ] = !( $ this ->indata ['all_html ' ] ?? false ) ? false : true ;
434
+ $ output ['startImport ' ]['add_cat ' ] = ( $ this ->indata ['add_cat ' ] ?? false ) ? true : false ;
432
435
433
436
$ output ['startImport ' ]['error ' ] = $ error ;
434
437
@@ -454,7 +457,7 @@ public function displayImport(): array
454
457
455
458
foreach ($ endOrder as $ order ) {
456
459
$ rowsTable = [];
457
- if (is_array ($ result [$ order ])) {
460
+ if (is_array ($ result [$ order ] ?? false )) {
458
461
foreach ($ result [$ order ] as $ v ) {
459
462
$ mapKeys = array_keys ($ v );
460
463
$ rowsTable [] = [
@@ -471,12 +474,12 @@ public function displayImport(): array
471
474
}
472
475
473
476
// back button
474
- if (is_array ($ this ->indata ['map ' ])) {
477
+ if (is_array ($ this ->indata ['map ' ] ?? false )) {
475
478
foreach ($ this ->indata ['map ' ] as $ fieldNr => $ fieldMapped ) {
476
479
$ output ['startImport ' ]['hiddenMap ' ][] = ['name ' => htmlspecialchars ('CSV_IMPORT[map][ ' . $ fieldNr . '] ' ), 'value ' => htmlspecialchars ($ fieldMapped )];
477
480
}
478
481
}
479
- if (is_array ($ this ->indata ['cat ' ])) {
482
+ if (is_array ($ this ->indata ['cat ' ] ?? false )) {
480
483
foreach ($ this ->indata ['cat ' ] as $ k => $ catUid ) {
481
484
$ output ['startImport ' ]['hiddenCat ' ][] = ['name ' => htmlspecialchars ('CSV_IMPORT[cat][ ' . $ k . '] ' ), 'value ' => htmlspecialchars ($ catUid )];
482
485
}
@@ -487,8 +490,7 @@ public function displayImport(): array
487
490
default :
488
491
// show upload file form
489
492
$ output ['subtitle ' ] = $ this ->getLanguageService ()->getLL ('mailgroup_import_header_upload ' );
490
-
491
- if (($ this ->indata ['mode ' ] === 'file ' ) && !(((strpos ($ currentFileInfo ['file ' ], 'import ' ) === false ) ? 0 : 1 ) && ($ currentFileInfo ['realFileext ' ] === 'txt ' ))) {
493
+ if ((($ this ->indata ['mode ' ] ?? '' ) === 'file ' ) && !(((strpos ($ currentFileInfo ['file ' ], 'import ' ) === false ) ? 0 : 1 ) && ($ currentFileInfo ['realFileext ' ] === 'txt ' ))) {
492
494
$ output ['upload ' ]['current ' ] = true ;
493
495
$ file = $ this ->getFileById ((int )$ this ->indata ['newFileUid ' ]);
494
496
if (is_object ($ file )) {
@@ -510,8 +512,8 @@ public function displayImport(): array
510
512
$ output ['upload ' ]['csv ' ] = htmlspecialchars ($ this ->indata ['csv ' ] ?? '' );
511
513
$ output ['upload ' ]['target ' ] = htmlspecialchars ($ this ->userTempFolder ());
512
514
$ output ['upload ' ]['target_disabled ' ] = GeneralUtility::_POST ('importNow ' ) ? 'disabled ' : '' ;
513
- $ output ['upload ' ]['newFile ' ] = $ this ->indata ['newFile ' ];
514
- $ output ['upload ' ]['newFileUid ' ] = $ this ->indata ['newFileUid ' ];
515
+ $ output ['upload ' ]['newFile ' ] = $ this ->indata ['newFile ' ] ?? '' ;
516
+ $ output ['upload ' ]['newFileUid ' ] = $ this ->indata ['newFileUid ' ] ?? 0 ;
515
517
}
516
518
517
519
$ output ['title ' ] = $ this ->getLanguageService ()->getLL ('mailgroup_import ' ) . BackendUtility::cshItem ($ this ->cshTable ?? '' , 'mailgroup_import ' );
@@ -726,7 +728,7 @@ public function doImport(array $csvData): array
726
728
* Hook for doImport Mail
727
729
* will be called every time a record is inserted
728
730
*/
729
- if (is_array ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['direct_mail/mod3/class.tx_directmail_recipient_list.php ' ]['doImport ' ])) {
731
+ if (is_array ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['direct_mail/mod3/class.tx_directmail_recipient_list.php ' ]['doImport ' ] ?? false )) {
730
732
$ hookObjectsArr = [];
731
733
foreach ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['direct_mail/mod3/class.tx_directmail_recipient_list.php ' ]['doImport ' ] as $ classRef ) {
732
734
$ hookObjectsArr [] = GeneralUtility::makeInstance ($ classRef );
@@ -756,7 +758,7 @@ public function addDataArray(array &$data, $id, array $dataArray): void
756
758
if ($ this ->indata ['all_html ' ]) {
757
759
$ data ['tt_address ' ][$ id ]['module_sys_dmail_html ' ] = $ this ->indata ['all_html ' ];
758
760
}
759
- if (is_array ($ this ->indata ['cat ' ]) && !in_array ('cats ' , $ this ->indata ['map ' ])) {
761
+ if (is_array ($ this ->indata ['cat ' ] ?? false ) && !in_array ('cats ' , $ this ->indata ['map ' ])) {
760
762
foreach ($ this ->indata ['cat ' ] as $ k => $ v ) {
761
763
$ data ['tt_address ' ][$ id ]['module_sys_dmail_category ' ][$ k ] = $ v ;
762
764
}
0 commit comments