Project

General

Profile

Actions

Bug #84080

closed

XML export breaks if RTE field contains link to a file

Added by Markus Klein over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Import/Export (T3D)
Target version:
Start date:
2018-02-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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:

  1. It introduces a strong coupling of the LinkHandler results with the SoftReference data structure
  2. It may cause side effects if a LinkHandler is changed, as the SoftReference data structure is implicitly modified
  3. 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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #80991: Linkvalidator: Links to files and pages not validatedClosed2017-04-24

Actions
Actions

Also available in: Atom PDF