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

History 29

  1. Gerrit Code Review pushed patch set 1 for main to change 81389 status New Under Review 10/09/23, 16:16

  2. Gerrit Code Review pushed patch set 2 for main to change 81389 10/11/23, 14:05

  3. Gerrit Code Review pushed patch set 3 for main to change 81389 10/26/23, 10:49

  4. Gerrit Code Review pushed patch set 4 for main to change 81389 10/26/23, 10:53

  5. Gerrit Code Review pushed patch set 5 for main to change 81389 10/26/23, 10:55

  6. Gerrit Code Review pushed patch set 6 for main to change 81389 10/26/23, 11:00

  7. Gerrit Code Review pushed patch set 7 for main to change 81389 10/26/23, 11:32

  8. Garvin Hicking commented and changed status Under Review Resolved done 0 % 100 % 10/26/23, 12:35

    Applied in changeset commit:9c6bdf6d3a557e756ef2e103e5c2ad13c8dff673.

  9. Benni Mack changed status Resolved Closed 07/09/24, 15:19