[TYPO3-core] RFC #4270 displayCond for flexforms, that affects on row of element
Tolleiv Nietsch
info at tolleiv.de
Tue Jun 9 21:46:45 CEST 2009
Hi - thanks for the feedback,
I hope this new patch fit's your needs and now it should follow the CGL. ;)
>
> hmm, I read it, too:
> (line 5732)
>
> if($ffValue && ...
>
> there is no $ffValue at this point.
Yes you're right for some reason this typo made it into the last patch -
it's fixed within the new patch...
>
> and even if that is fixed, it will still not work because filling
> $theFieldValue with $row[$parts[1]][$ffValueKey] (in case $parts[1]
> contains 'parentRec.') is nonsense - we want $row[$parts[1]] at this point.
> and btw: conditions referencing normal ff fields will not work anymore.
>
> something like this would work:
> if ($ffValueKey && strpos($parts[1],'parentRec.')!==FALSE) {
> $theFieldValue = $row[$parts[1]];
> } else {
> $theFieldValue = ($ffValueKey ? $row[$parts[1]][$ffValueKey] :
> $row[$parts[1]]);
> }
That's what it looks like now:
$theFieldValue = $row[$parts[1]];
if($ffValueKey && strpos($parts[1], 'parentRec.')===FALSE) {
$theFieldValue = $row[$parts[1]][$ffValueKey];
}
The first line is what we want in most cases, no matter if there a
"parentRec." in the key or not. If it's not a "parentRec."-field and if
there's a $ffValueKey then we want the sub-part of this array. Pretty
straight forward - I changed stristr() and strpos() since imho it's
easier to read the code with strpos().
Let me know if you have any further feedback,
greets
Tolleiv
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t3lib_tceforms.php-4270-2.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090609/198de733/attachment.txt
More information about the TYPO3-team-core
mailing list