Bug #65725
closedReferenceIndex takes WorkspaceOverlay into account
0%
Description
State of the
if ($conf['type'] === 'flex')condition of ReferenceIndex::getRelations() before 10.04.2006 11:27:
// Get current value array: $dataStructArray = t3lib_BEfunc::getFlexFormDS($conf, $row, $table,'',$this->WSOL); $currentValueArray = t3lib_div::xml2array($value); // Traversing the XML structure, processing files: if (is_array($currentValueArray)) { $this->temp_flexRelations = array( 'db' => array(), 'file' => array(), 'softrefs' => array() ); $iteratorObj = t3lib_div::makeInstance('t3lib_TCEmain'); $iteratorObj->callBackObj = &$this; $iteratorObj->checkValue_flex_procInData( $currentValueArray['data'], array(), // Not used. array(), // Not used. $dataStructArray, array($table,$uid,$field), // Parameters. 'getRelations_flexFormCallBack' ); // Create an entry for the field: $outRow[$field] = array( 'type' => 'flex', 'flexFormRels' => $this->temp_flexRelations, ); }State after Commit 0c34dac08605ba from Michael Stucki on 10.04.2006 11:27
- Merging all changes from TYPO3_4-0 branch back into HEAD
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1421 709f56b5-9817-0410-a4d7-c38de5d9e867
// Get current value array: $dataStructArray = t3lib_BEfunc::getFlexFormDS($conf, $row, $table,'',$this->WSOL); $currentValueArray = t3lib_div::xml2array($value); // Traversing the XML structure, processing files: if (is_array($currentValueArray)) { $this->temp_flexRelations = array( 'db' => array(), 'file' => array(), 'softrefs' => array() ); // Create and call iterator object: $flexObj = t3lib_div::makeInstance('t3lib_flexformtools'); $flexObj->traverseFlexFormXMLData($table,$field,$row,$this,'getRelations_flexFormCallBack'); // Create an entry for the field: $outRow[$field] = array( 'type' => 'flex', 'flexFormRels' => $this->temp_flexRelations, ); }
Before the commit filling temp_flexRelations was done by a call to checkValue_flex_procInData passing $dataStructArray created with
$dataStructArray = t3lib_BEfunc::getFlexFormDS($conf, $row, $table,'',$this->WSOL);
After moving the functionality to t3lib_flexformtools::traverseFlexFormXMLData() (today TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools)
the parameter $this->WSOL got lost. Its not passed to the class and fetching $dataStructArray there is done by calling
$dataStructArray = BackendUtility::getFlexFormDS($GLOBALS['TCA'][$table]['columns'][$field]['config'], $row, $table, $field);
without the fifth parameter $WSOL.
$this->WSOL is defined as FALSE by default in ReferenceIndex and is overwritten with TRUE only in ImportExport::export_addRecord()
The signature of BackendUtility::getFlexFormDS looks like this:
* @param bool $WSOL If set, workspace overlay is applied to records. This is correct behaviour for all presentation and export, but NOT if you want a TRUE reflection of how things are in the live workspace. */ static public function getFlexFormDS($conf, $row, $table, $fieldName = '', $WSOL = TRUE, $newRecordPidValue = 0) {
This means:
Before the commit from Michael Stucki the ReferenceIndex passed $this->WSOL = FALSE to BackendUtility::getFlexFormDS() fetching the "TRUE reflection of how things are in the live workspace".
After the commit the parameter $WSOL defaults to TRUE in the call via FlexFormTools::traverseFlexFormXMLData() returning the record with applied workspace overlay.
I am not sure about the consequences yet.
Updated by Stephan Großberndt over 9 years ago
The definition of ReferenceIndex::generateRefIndexData() clearly states:
* If the result is used to update the sys_refindex table then ->WSOL must NOT be TRUE (no workspace overlay anywhere!)
Since traverseFlexFormXMLData() gets an instance of the class anyway as $callBackObj the call could be changed to
$WSOL = property_exists($callBackObj, 'WSOL')) ? $callBackObj->WSOL : TRUE; $dataStructArray = BackendUtility::getFlexFormDS($GLOBALS['TCA'][$table]['columns'][$field]['config'], $row, $table, $field, $WSOL);
Updated by Gerrit Code Review over 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37836
Updated by Gerrit Code Review over 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37836
Updated by Gerrit Code Review over 9 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37836
Updated by Gerrit Code Review about 9 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37836
Updated by Gerrit Code Review about 9 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/37836
Updated by Stephan Großberndt almost 7 years ago
- Status changed from Under Review to New
Updated by Oliver Hader almost 5 years ago
- Status changed from New to Closed
I'm pretty sure that this one was a left-over. Focussing on FlexForm for WSOL
only does not make much sense... this probably(!) was a work-around for old TemplaVoila handling - workspace references stored inline in the document were more specific - thus, it seems that this flag disabled (more expensive) processing of nested XML structures.
Property ReferenceIndex::WSOL
can be deleted