Issue Bug Closed

#102130T3D data structure with sys_file_reference entries and missing files makes import fail with type check errors

Garvin Hicking 10/09/23, 16:05 updated 07/09/24, 15:19

Description

From:

https://stackoverflow.com/questions/77255080/t3d-file-import-error-htmlspecialchars-argument-1-string-must-be-of-typ/77255438

Using a T3D file with a structure as below, containing sys_file_reference records with missing files, will make the T3D importer fail because if missing array indices and assumptions that will fail, and not import any content. The core should more “gracefully” fail on this to at least be able to import partial data (with error messages)

Errors yielded were:

Sun, 08 Oct 2023 18:27:27 +0000 [WARNING] request="418b1cee8d80d" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (BE): PHP Warning: Undefined array key "8e79286a8efa8a13de373312028aee83" in /srv/www/typo3_src-12.4.6/typo3/sysext/impexp/Classes/ImportExport.php line 721
Sun, 08 Oct 2023 18:27:27 +0000 [WARNING] request="418b1cee8d80d" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (BE): PHP Warning: Trying to access array offset on value of type null in /srv/www/typo3_src-12.4.6/typo3/sysext/impexp/Classes/ImportExport.php line 738
            [records] => Array
                (
                    [sys_file_reference] => Array
                        (
                            [22] => Array
                                (
                                    [uid] => 22
                                    [pid] => 1
                                    [title] => 1024_Kirchhofen_Kirchturm.jpg
                                    [size] => 910
                                    [rels] => Array
                                        (
                                            [sys_file:22] => Array
                                                (
                                                    [id] => 22
                                                    [table] => sys_file
                                                )

                                        )

                                    [softrefs] => Array
                                        (
                                            [link:typolink:4463318f6facace53c799ec9ac121f98:0] => Array
                                                (
                                                    [field] => link
                                                    [spKey] => typolink
                                                    [matchString] => fileadmin/kartan.de/bilder/St_Georgen/1024_Kirchhofen_Kirchturm.jpg
                                                    [subst] => Array
                                                        (
                                                            [type] => file
                                                            [relFileName] => fileadmin/kartan.de/bilder/St_Georgen/1024_Kirchhofen_Kirchturm.jpg
                                                            [tokenID] => 4463318f6facace53c799ec9ac121f98
                                                            [tokenValue] => fileadmin/kartan.de/bilder/St_Georgen/1024_Kirchhofen_Kirchturm.jpg
                                                        )

                                                    [error] => File does not exist!
                                                    [file_ID] => 8e79286a8efa8a13de373312028aee83
                                                )

                                        )

                                )

Reviews 1