Issue Bug Closed

#60135Nested stdWraps cause multiple "function calls"

Anonymous 07/07/14, 11:30 updated 10/02/18, 11:54

Description

In case of nested stdWraps, the specified objects (like TEXT or USER) will be called multiple times even though the output is still only being rendered once. This sucks especially for userfuncs and REGISTER (the “famous” counter scenario).

page = PAGE
page {
  10 = TEXT
  10.value = page.10.value<br>
  10.append = TEXT
  10.append.value = page.10.append.value<br>
  10.stdWrap.append = TEXT
  10.stdWrap.append.value = page.10.stdWrap.append.value<br>
}

The output in the browser is as expected:

page.10.value
page.10.stdWrap.append.value
page.10.append.value

If you now modify the TEXT class (typo3/sysext/frontend/Classes/ContentObject/TextContentObject.php) and prepend the following to render():

var_dump($conf['value']);

you’ll see that this object is acutally being called not 3 but 4 times! I guess it’s also possible to track this behaviour with the admin panel.

Anyway, to render “page.10.stdWrap.append.value” its TEXT object is being called two times, which is one time too much, imho. If you wrap it within another stdWrap, it’s even called 4 times.

Reviews 2