[TYPO3-dev] stdWrap for all TLO's

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Mar 27 21:44:41 CET 2008


Hi,

JoH wrote: on 27.03.2008 20:30:

>> Sorry for only following up now, but of course it does damage.
>> Imagine:
>> obj = USER
>> obj.stdWrap.wrap = <div class="bla">|</div>
>>
>> If the USER method already called stdWrap at the end, the output will
>> already have a <div> around. If TYPO3 core now also calls stdWrap on
>> that, of course you get two <div>s around the output. Same for all
>> other transformations applied by stdWrap, some might even be more
>> dangerous than this one.
> 
> It seems you still don't get the point.
> If there already is a <div>|</div> or whatever the stdWrap added to the 
> output of the plugin, fine with me. No need to use the default stdWrap of 
> the USER element.

What do you mean with "use"? Either we (the core) applies it or not.

> But if this is not the case because the developer didn't apply any stdWrap 
> functionality the default stdWrap would come in handy.

This I agree.

But still that doesn't answer the problem of extensions that already are 
using the stdWrap property already inside the USER code. Say we have:

	obj = USER
	obj.stdWrap.wrap = <div class="ya">|</div>

Now in my plugin I have (the plugin is 5 years old, it always worked 
like that):

	function main($conf)
		...
		return $this->cObj->stdWrap($out, $conf['stdWrap.']);
	}

And now we add the functionality in CORE so that a "default stdWrap" is 
always applied. Note that CORE doesn't know that the plugin already 
applied the stdWrap. So core goes and also:

	cObj->stdWrap($pluginOutput, $conf['stdWrap.']);


And now we've got:

	<div class="ya"><div class="ya">|</div></div>

and we (the admin) have no way to get rid of the double application of 
the stdWrap, without changing the extension / plugin PHP source-code. 
Imagine that the "stdWrap" property was being used by some totally 
different reason inside the plugin (e.g. as a standard stdWrap for every 
field...), we cannot simply "re-use" that for a default stdWrap.

So in my eyes we either need another "name" for that (one that hasn't 
been used by plugins so far) or we just assume that all extensions that 
do use the "stdWrap" are deprecated (or just work with TYPO3 < 4.3).

Or is something wrong about that thought?

Cheers,
Ernesto




More information about the TYPO3-dev mailing list