Bug #66572 » patch-66572.diff
typo3/sysext/version/Classes/Dependency/DependencyEntityFactory.php | ||
---|---|---|
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 .
|
||
*
|
||
* @see http://docs.typo3.org/typo3cms/TCAReference/Reference/Ctrl/Index.html#versioningws
|
||
*
|
||
* @return boolean
|
||
*/
|
||
protected function isVersionable($table) {
|
||
return (bool)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'];
|
||
}
|
||
}
|
typo3/sysext/version/Classes/Dependency/ElementEntity.php | ||
---|---|---|
$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;
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
$arguments = array('table' => $row['tablename'], 'id' => $row['recuid'], 'field' => $row['field'], 'scope' => self::REFERENCES_ParentOf);
|
||
$callbackResponse = $this->dependency->executeEventCallback(self::EVENT_CreateParentReference, $this, $arguments);
|
||
if ($callbackResponse !== self::RESPONSE_Skip) {
|
||
$this->parents[] = $this->getDependency()->getFactory()->getReferencedElement(
|
||
$parent = $this->getDependency()->getFactory()->getReferencedElement(
|
||
$row['tablename'],
|
||
$row['recuid'],
|
||
$row['field'],
|
||
array(),
|
||
$this->getDependency()
|
||
);
|
||
// NULL nicht mit hinzufügen
|
||
if(NULL !== $parent) {
|
||
$this->parents[] = $parent;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return $this->parents;
|
||
}
|
||
... | ... | |
$this->outerMostParent = FALSE;
|
||
/** @var $parent \TYPO3\CMS\Version\Dependency\ReferenceEntity */
|
||
foreach ($parents as $parent) {
|
||
$outerMostParent = $parent->getElement()->getOuterMostParent();
|
||
if ($outerMostParent instanceof \TYPO3\CMS\Version\Dependency\ElementEntity) {
|
||
$this->outerMostParent = $outerMostParent;
|
- « Previous
- 1
- 2
- Next »