[TYPO3-dev] Dynaflex and ###REC_FIELD_...###

Nikolas Hagelstein hagelstein at shr.cc
Thu Nov 23 16:55:26 CET 2006


Hi,
>You can use ###fieldname### instead of ###REC_FIELD_whatever###. Should
be working. 
>But this is without any guaranty because I'm not 100% sure that I have
implemented this at that position. 
No it is not. I had a short look at the source of dynaflex and there are
2 things i would like to suggest:

1. CE markers within modifications source_config:
ATM only ce_uid and ce_pid are replaced within source_config. This could
be extended by adding a $this->ceFields
property. Since you are fetching the ce record to dermine the PID anyway


e.g.:

line 130 class.dynaflex.php:
-/+ $pidRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*',
$this->ceTable, 'uid='.$this->ceUid);					

line 133 class.dynaflex.php:
+$this->ceFields = $pidRes;

-/+ line 756 class.dynaflex.php:
preg_match_all('/###(.[^#]*)###/i', $handling['where'], $whereMarker);
for ($index = 0; $index < count($whereMarker[0]); $index++) {
	$handling['where'] = str_replace($whereMarker[0][$index], 
		$this->ceFields[$whereMarker[1][$index]], 
		$handling['where']);
 }	

2.Foreign table where clause markers withhin field_config.
ATM marker replacement is done for label and name. What about eighter
allowing markers across the whole field_config item or at least for the 
foreign_table_where field?

Quick n dirty hack for adding ftw marker would be.

line 874 class.dynaflex.php:
+ preg_match_all('/###(.[^#]*)###/i',
$fConf['config']['foreign_table_where'], $ftwMarker);

line 874 class.dynaflex.php:
+ for ($index = 0; $index < count($ftwMarker[0]); $index++) {
    $aConfig['config']['foreign_table_where'] =
      str_replace($ftwMarker[0][$index],
	$fieldData[$ftwMarker[1][$index]], 
	$aConfig['config']['foreign_table_where']);
  }
					

IMHO the way of replacing markers needs to be thought over because it is
spreaded all over
the code ;)

Tell me what do you think about the above mentioned.

Cheers,
Nikolas




More information about the TYPO3-dev mailing list