Bug #84080
closedXML export breaks if RTE field contains link to a file
100%
Description
Exporting a page with tt_content holding a link to a file crashes the export with
#1476107295: PHP Warning: strlen() expects parameter 1 to be string, object given in typo3/sysext/core/Classes/Utility/GeneralUtility.php line 1754
This is the GeneralUtility:array2xml export function.
The reason for this warning is that the array passed to the xml converter function includes objects.
To be precise a FAL File object.
It turns out that the subarray holding this object actually stems from the processing chain Export -> ReferenceIndex -> SoftReferenceIndex -> LinkService -> FileLinkHandler
This file object is part of the SoftReference data structure due to the change done with #80991 (1522bad3362b0e68d404b09cc1eadae45970ddcc), which added the result of the LinkHandler to the SoftReference structure.
In the case of FileLinkHandler this includes the File object of the referenced file.
Exporting such a thing as t3d works, as the object (incl. its nested Storage object) is simply serialized.
But exporting this as XML fails, due to array2xml being unable to cope with objects.
Having this information included causes multiple issues:
- It introduces a strong coupling of the LinkHandler results with the SoftReference data structure
- It may cause side effects if a LinkHandler is changed, as the SoftReference data structure is implicitly modified
- It violates the "interface" to the SoftReferenceIndex class, which precisely describes, what it delivers.
The solution to this issue is that it is not necessary to include the whole information from the LinkHandler into the SoftReference data structure, as no component is using it.
Updated by Markus Klein over 6 years ago
- Related to Bug #80991: Linkvalidator: Links to files and pages not validated added
Updated by Gerrit Code Review over 6 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55939
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55969
Updated by Markus Klein over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 0723ba06b5037ff56df9d1be28d0b16f4bdbc912.