pageRenderer was resetted after render call
I found following lines in DocumentTemplate.php:
$str = $this->pageRenderer->render(PageRenderer::PART_HEADER); $this->JScodeLibArray = array(); $this->JScode = ($this->extJScode = ''); $this->JScodeArray = array(); $this->endOfPageJsBlock = $this->pageRenderer->render(PageRenderer::PART_FOOTER);
As you can see pageRenderer->render was called two times with different arguments.
But in pageRenderer->render you call $this->reset();
So...second call for Footer has no data to render.
$this->reset() was called from __constructor(). So in my opinion we should remove this line.
Updated by Benni Mack 9 months ago
- Status changed from Accepted to Closed
this change was finally possible to be fixed in v11:
- DocumentTemplate is not in use anymore
- ModuleTemplate only uses one call $this->pageRenderer->render()
Unfortunately, this change was too complex to be backported to a LTS version, as others mentioned that they relied on this behavior to add code in their extensions.
I strongly recommend to use the AssetCollector API via Fluid ViewHelpers to add CSS/JS for Backend and Frontend (starting in v10) as this state is not reseted intentionally.
If you feel otherwise or have another solution for v10, let me know so I can re-open the issue.