[BUGFIX] Prevent wrong ref_index for fields with soft references 72/37372/2
authorNicole Cordes <typo3@cordes.co>
Thu, 19 Feb 2015 09:55:13 +0000 (10:55 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 28 Feb 2015 20:09:05 +0000 (21:09 +0100)
commitf47d624b97d841f726ceae71649e9636af7eb164
tree047003fb1b86ecc081e0234e94e78e075eb3503b
parent40281c48a5d846c4252c0e0f135687ebad6aea04
[BUGFIX] Prevent wrong ref_index for fields with soft references

If you add a page link to a field which is defined as softrefs, the
ReferenceIndex creates an index to a FAL record if there exists a file
record with the page id. As file links are always prefixed with 'file:'
this patch adds a proper check before generating a file ref_index.

Because the functional tests of impexp extension still use a hardcoded
file path for the header_link field the patch corrects the value to
refer to a file.

Furthermore if you add a file or folder link, the field is referenced
twice for the FAL record. So we have to suppress the softreference for
those records.

Releases: master, 6.2
Resolves: #60226
Change-Id: I969224e2a291491cb7ece1f61b375071bf0eaebc
Reviewed-on: http://review.typo3.org/37372
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/Database/ReferenceIndex.php
typo3/sysext/impexp/Tests/Functional/Fixtures/Database/tt_content.xml
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent.xml
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContent/DataSet/Assertion/importPagesAndRelatedTtContent.csv