[TYPO3-dam] Bug with option "set fixed" in indexing module + fix

Franz Koch typo3 at fx-graefix.de
Sat Mar 25 18:06:13 CET 2006


Hi,

I think I just found a bug in the indexing module of the latest 
dam-snapshot (16-03-2006) on typo3 CVS-Snapshot (23-03-2006).
Please check this in your installations.


Here the bug:
---------------------------------------------------------------------
In module 'media->indexing' once a field has been set to be a fixed 
value for current indexing, the value can't be unselected anymore, if 
decided otherwise (well the form does unselect, but in the next step the 
change is lost).

A simple bugfix would be to unset the related variable in array 
$this->index->dataPostset.
Here my changes to 'ext/dam_index/modfunc_index/class.tx_damindex_index.php'

----- beginning on line 971 ----------
// before
foreach($data['tx_dam_simpleforms'][1] as $field => $value) {
	if(in_array($field,$fixedFields)) {
		$this->index->dataPostset[$field] = $value;
	} else {
		$this->index->dataPreset[$field] = $value;
	}
}

// after
foreach($data['tx_dam_simpleforms'][1] as $field => $value) {
	if(in_array($field,$fixedFields)) {
		$this->index->dataPostset[$field] = $value;
	} else {
		if($this->index->dataPostset[$field]) {
			unset($this->index->dataPostset[$field]);
		}
		$this->index->dataPreset[$field] = $value;
	}
}

--------------------------------------

Have a nice weekend...

-- 
Kind regards,
Franz Koch



More information about the TYPO3-project-dam mailing list