[BUGFIX] Respect _FILE/_STRING in versioning 56/39856/4
authorAlexander Opitz <opitz.alexander@googlemail.com>
Mon, 1 Jun 2015 09:32:48 +0000 (11:32 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 6 Jun 2015 13:17:49 +0000 (15:17 +0200)
References with _FILE/_STRING as ref_table have special meanings and
can't be loaded from database.

Resolves: #66572
Releases: master, 6.2
Change-Id: Ibc942c600652a005368e1eab67cbc24f4efb7dde
Reviewed-on: http://review.typo3.org/39856
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/version/Classes/Dependency/ElementEntity.php

index 4056f3e..5d09f02 100644 (file)
@@ -213,16 +213,24 @@ class ElementEntity {
                        $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_refindex', $where, '', 'sorting');
                        if (is_array($rows)) {
                                foreach ($rows as $row) {
-                                       $arguments = array('table' => $row['ref_table'], 'id' => $row['ref_uid'], 'field' => $row['field'], 'scope' => self::REFERENCES_ChildOf);
-                                       $callbackResponse = $this->dependency->executeEventCallback(self::EVENT_CreateChildReference, $this, $arguments);
-                                       if ($callbackResponse !== self::RESPONSE_Skip) {
-                                               $this->children[] = $this->getDependency()->getFactory()->getReferencedElement(
-                                                       $row['ref_table'],
-                                                       $row['ref_uid'],
-                                                       $row['field'],
-                                                       array(),
-                                                       $this->getDependency()
+                                       if ($row['ref_table'] !== '_FILE' && $row['ref_table'] !== '_STRING') {
+                                               $arguments = array(
+                                                       'table' => $row['ref_table'],
+                                                       'id' => $row['ref_uid'],
+                                                       'field' => $row['field'],
+                                                       'scope' => self::REFERENCES_ChildOf
                                                );
+
+                                               $callbackResponse = $this->dependency->executeEventCallback(self::EVENT_CreateChildReference, $this, $arguments);
+                                               if ($callbackResponse !== self::RESPONSE_Skip) {
+                                                       $this->children[] = $this->getDependency()->getFactory()->getReferencedElement(
+                                                               $row['ref_table'],
+                                                               $row['ref_uid'],
+                                                               $row['field'],
+                                                               array(),
+                                                               $this->getDependency()
+                                                       );
+                                               }
                                        }
                                }
                        }