Project

General

Profile

Bug #66572 » patch.diff

Klaus Moser, 2015-04-24 14:46

View differences:

typo3/sysext/version/Classes/Dependency/DependencyEntityFactory.php 2015-04-16 09:32:44.000000000 +0200 → typo3/sysext/version/Classes/Dependency/DependencyEntityFactory.php 2015-04-24 13:05:41.997675074 +0200
protected $references = array();
/**
* @var array
*/
protected $tables = array();
/**
* Gets and registers a new element.
*
* @param string $table
......
* @see getReference
*/
public function getReferencedElement($table, $id, $field, array $data = array(), \TYPO3\CMS\Version\Dependency\DependencyResolver $dependency) {
return $this->getReference($this->getElement($table, $id, $data, $dependency), $field);
if (empty($this->tables)) {
$tables = $GLOBALS['TYPO3_DB']->admin_get_tables();
$this->tables = array_keys($tables);
}
if (in_array($table, $this->tables) && $this->isVersionable($table)) {
return $this->getReference($this->getElement($table, $id, $data, $dependency), $field);
} else {
return NULL;
}
}
/**
* Check if versioning is enabled .
*
* @return boolean
*/
protected function isVersionable($table) {
return ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] === '1');
}
}
typo3/sysext/version/Classes/Dependency/ElementEntity.php 2015-04-16 09:32:44.000000000 +0200 → typo3/sysext/version/Classes/Dependency/ElementEntity.php 2015-04-23 17:58:43.541046599 +0200
$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(
$child = $this->getDependency()->getFactory()->getReferencedElement(
$row['ref_table'],
$row['ref_uid'],
$row['field'],
array(),
$this->getDependency()
);
if (!empty($child))
$this->children[] = $child;
}
}
}
(1-1/2)