[FOLLOWUP][BUGFIX] Prevent wrong ref_index for fields with soft references 11/37511/3
authorNicole Cordes <typo3@cordes.co>
Tue, 3 Mar 2015 21:46:03 +0000 (22:46 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 5 Mar 2015 10:06:28 +0000 (11:06 +0100)
Prevent problems with NULL values in reference fields.

Releases: master, 6.2
Resolves: #60226
Change-Id: I168e508ca9d47a3047a7b11bed0c315186ff2e2a
Reviewed-on: http://review.typo3.org/37511
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Mateusz Wojtuła <matw88@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Database/ReferenceIndex.php

index 0a9a87e..db510fc 100644 (file)
@@ -727,7 +727,7 @@ class ReferenceIndex {
                                );
                        }
                        return $fileArray;
-               } elseif ($conf['type'] == 'input' && isset($conf['wizards']['link']) && StringUtility::beginsWith($value, 'file:')) {
+               } elseif ($conf['type'] == 'input' && isset($conf['wizards']['link']) && $value !== NULL && StringUtility::beginsWith($value, 'file:')) {
                        try {
                                $file = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($value);
                        } catch (\Exception $e) {