Issue Bug Under Review Quiet

#91086PageRenderer doesn't include resources included by USER_INT objects on cache miss

Deividas Simas 04/17/20, 14:28 updated 10/16/26, 19:04

Description

Hello friends :)

I’ve came across a strange misconduct after reloading a page without cache (logged in on backend and ctrl+f5) on a page with USER objects and exactly one USER_INT that includes a script using PageRenderer->addJsFooterFile. Also happens with CSS.

The file will not be included as long as the cache misses and there is at least one USER object.
After a normal reload (F5) everything works fine.

I was checking out in the core and it seems that a different PageRenderer is being used by ObjectManager than restored in TypoScriptFrontendController:3767 (v.9.5.14).

That solved my problem

Didn’t work:
$this->objectManager->get(PageRenderer::class)->addJsFooterFile

Worked:
$GLOBALS[‘TSFE’]->pageRenderer->addJsFooterFile

I also didn’t try to reproduce that on a fresh installation yet.

Reviews 1

History 34

  1. Deividas Simas commented <span data-processor="relativetime" data-value="2020-04-23T13:17:03+00:00" > 04/23/20, 13:17 </span>

    I could reproduce this issue on a fresh typo3 9.5.15 installation with following setup:

    extension with 2 controllers:
    User (with empty action)
    Userint (has `$this->objectManager->get(PageRenderer::class)->addJsInlineCode(‘tester’, ‘console.log(“User INT”);’);`)

    The Action of UserintController uncached (added in nonCachableActions array of ExtensionUtility::configurePlugin)

    register 2 plugins and print them both out on same page.

    Result:

    CTRL+F5 will not print the inline JS code. after F5 it appears on header

  2. Deividas Simas commented <span data-processor="relativetime" data-value="2020-04-23T14:00:32+00:00" > 04/23/20, 14:00 </span>

    TYPO3 10 doesn’t seem to add js files from uncached objects at all. I tried with following in UserintController:

    $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class)->addJsFooterFile(‘EXT:extension_name/test.js’);

    Nothing happened while UserController did print the script tag accordingly.