Issue Bug Closed

#110025ObjectStorage->contains not working anymore with overlays off

Nikita Hovratov 06/09/26, 16:10 updated 09/02/26, 08:00

Description

The spl_object_hash in the comparison returns different hashes since TYPO3 v14.
This leads to ObjectStorage->contains to not work anymore.

Reviews 1

Files 1

History 714

  1. Nikita Hovratov commented and changed attached persistence-session.png <span data-processor="relativetime" data-value="2026-06-09T17:52:27+00:00" > 06/09/26, 17:52 </span>

    The root cause is, that an object is put 2 times into the session, with different identifiers.
    Background: In our application, we have a domain model for the frontend user and we retrieve it the first time in the “normal” page rendering scope. Then, inside an extbase plugin, we use this logged in user to check for access rights. For this we retrieve the currently logged in user again. This is where the second entry with different parameters for the language is created. The first is “1502@0-includeFloating-0,pageNotFound” and the second is “1502@0-mixed-0,pageNotFound”. It seems that in extbase sub-request scope there is a different LanguageAspect than in the parent request.

    Site language config is:

        title: 'Globe English'
        enabled: true
        base: /en/
        typo3Language: default
        locale: en_GB.utf8
        iso-639-1: en
        navigationTitle: English
        hreflang: en-GB
        direction: ltr
        fallbackType: free
        fallbacks: '0'
        flag: en-us-gb
        languageId: 1

    persistence-session.png

  2. Nikita Hovratov commented <span data-processor="relativetime" data-value="2026-06-09T18:25:12+00:00" > 06/09/26, 18:25 </span>

    It seems like DataMapper and Backend use different LanguageAspect mappings:

    DataMapper L:514

    OVERLAYS_OFF -> OVERLAYS_MIXED

            $languageAspect = new LanguageAspect(
                $languageUid,
                $languageUid,
                $languageAspect->getOverlayType() === LanguageAspect::OVERLAYS_OFF ? LanguageAspect::OVERLAYS_MIXED : $languageAspect->getOverlayType(),
                $languageAspect->getFallbackChain()
            );

    Backend L:169

    OVERLAYS_OFF -> OVERLAYS_ON_WITH_FLOATING

            $languageAspect = new LanguageAspect(
                $languageAspect->getId(),
                $languageAspect->getContentId(),
                $languageAspect->getOverlayType() === LanguageAspect::OVERLAYS_OFF ? LanguageAspect::OVERLAYS_ON_WITH_FLOATING : $languageAspect->getOverlayType(),
                $languageAspect->getFallbackChain()
            );
  3. Nikita Hovratov changed subject ObjectStorage->contains not working anymore ObjectStorage->contains not working anymore with overlays off <span data-processor="relativetime" data-value="2026-06-09T18:35:50+00:00" > 06/09/26, 18:35 </span>