Revert "[BUGFIX] Prevent wrong ref_index for fields with soft references" 83/37083/2
authorNicole Cordes <typo3@cordes.co>
Sat, 21 Feb 2015 20:26:36 +0000 (21:26 +0100)
committerNicole Cordes <typo3@cordes.co>
Sat, 21 Feb 2015 20:26:44 +0000 (21:26 +0100)
This reverts commit 91732f299bfa625f3e9e54873efbad2fda96d11a.

Change-Id: Ic25804fb0ef1b96a78d83285d9c425dc5d37f02d
Reviewed-on: http://review.typo3.org/37083
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/core/Classes/Database/ReferenceIndex.php

index 4a81165..7365a5a 100644 (file)
@@ -314,10 +314,7 @@ class ReferenceIndex {
                                                        switch ((string) $el['subst']['type']) {
                                                                case 'db':
                                                                        list($tableName, $recordId) = explode(':', $el['subst']['recordRef']);
-                                                                       // Prevent double references for files and file relations
-                                                                       if ($tableName !== 'sys_file' && $tableName !== 'sys_file_reference') {
-                                                                               $this->relations[] = $this->createEntryData($table, $uid, $fieldname, $flexpointer, $deleted, $tableName, $recordId, '', -1, $spKey, $subKey);
-                                                                       }
+                                                                       $this->relations[] = $this->createEntryData($table, $uid, $fieldname, $flexpointer, $deleted, $tableName, $recordId, '', -1, $spKey, $subKey);
                                                                        break;
                                                                case 'file_reference':
                                                                        // not used (see getRelations()), but fallback to file
@@ -610,7 +607,7 @@ class ReferenceIndex {
                                $fileArray[] = array('table' => 'sys_file', 'id' => $fileUid['uid_local']);
                        }
                        return $fileArray;
-               } elseif ($conf['type'] == 'input' && isset($conf['wizards']['link']) && GeneralUtility::isFirstPartOfStr($value, 'file:')) {
+               } elseif ($conf['type'] == 'input' && isset($conf['wizards']['link']) && trim($value)) {
                        try {
                                $file = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($value);
                        } catch (\Exception $e) {