[BUGFIX] Prevent wrong ref_index for fields with soft references 86/37086/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:08:40 +0000 (21:08 +0100)
commit0064da7fb7714dc007fae4839d26d0c5feae8414
tree427580e96a9fb172253511add9f4b04382d69fb9
parent2fac925ca593ce626a82de8ab0b8661feade8f55
[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/37086
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Göran Bodenschatz <coding@46halbe.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
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