[TYPO3-core] RFC: #10359: Empty subparts are ignored

Steffen Ritter info at rs-websystems.de
Sat Aug 15 16:53:42 CEST 2009


Jigal van Hemert schrieb:
> Hi Steffen,
> 
> Steffen Kamper wrote:
>> i don't see a sense in returning this string.
>> But a good addition would be to if there is no pair
>> a) add syslog
>> b) add message to admPanel with $GLOBALS['TT']->setTSlogMessage
>>
>> i would prefer b)
> 
> I don't see a sense in logging a message anywhere, because there is no 
> need for a warning or an error.
> 
> The problem is in getSubPart() returning an empty string when the 
> markers aren't found. It should return FALSE and then the code which 
> calls the function can distinguish between empty/zero content and 
> missing markers.
> Returning FALSE doesn't really solve the problem because many pieces of 
> code only test on the boolean evaluation of the returned value.
> 
> Returning this string doesn't break any templating and it solves the 
> problem of the boolean evaluation.
> 
> I'm more than happy to change the function that it returns FALSE if the 
> marker(s) aren't found and patch the cases I've found in core + 
> automaketemplate. In this case fixing the problem in other extensions 
> has to be left to the authors of those extensions.
> 
> Regards,
> 
Sorry, but I think this makes no sense...
Evaluating empty subpart to false is the correct behaviour, since it 
means "nothing to do".
Why should an emppty subpart rise processing which never will get used?
So it is an performance degree, instead of an improvement.

And if for automaketemplate considers <div id="iamempty"></div> as an 
subpart, i think this is the wrong behaviour or, the user wants to use 
it wrong. To me the sense is to mark some parts in an (complete) 
html-template as "typoscriptable" by wrapping it. If I have an empty 
div, not wrapping anything, this is nothing to replace but some design 
helper.
So that "getSubpart" would return 0 is the right thing, I think.

After thinking about the topic, reading the discussion and testing 
something,

I'm -1 to your RFC,

and i am completely with Steffen Kampers part b.

regards

Steffen


More information about the TYPO3-team-core mailing list