[TYPO3-core] t3lib_BEfunc::getProcessedValue hook fixes

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Nov 17 13:38:15 CET 2006


Dmitry Dulepov schrieb:
> Hi!
> 
> Martin Kutschker wrote:
> 
>> No. The hook has the $fieldName in it's defintion, but it simply will 
>> never get any value.
> 
> You did not understand my point. If any ~extension~ calls this function 
> (t3lib_befunc::getFlexFormDS) in old way, it will fail. You are trying 
> to change API function, which is bad.

Duh? Please read the code! I do not change the API in 4.0.x, I merely want 
to make the Core use it correctly.

I do propose a slight change to the API for 4.1. But I only want to make 
$fieldName mandatory. Any caller of the function will know the field 
anyway, so it's easy to cope with that change.

And we really need a distcinion between "private" API and the real public 
API. If we cannot change any function because someone *might* use it from 
an extension TYPO3 5.0 will be a bunch of deprecated and whacky 
backward-compatibility flags as TYPO3 4.x is.

>> Have a look at t3lib_befunc::getFlexFormDS() and the call of the hook. 
>> You'll see $fieldName. Now grep for getFlexFormDS() in the Core. Ouch, 
>> noone bothered to pass $fieldName to getFlexFormDS().
> 
> I did that and I agree that this is bad and should be corrected. But I 
> am against making that parameter mandatory due to possibly broken 
> compatibility. API functions cannot change signatures freely. We agreed 
> already once that if parameter is added, it is added to the end of 
> function and made optional. This preserves compatibility.

Who the *#**! ouside the Core is supposed to use this function? The 
fieldName is NOT ADDED and without the $fieldName we can remove the hook 
altogether as it just won't work: No fieldName, not enough data to work on.

Masi



More information about the TYPO3-team-core mailing list