Skip to content

IBX-12102: Fixed SiteAccess context being lost after fragment sub-requests - #802

Merged
tbialcz merged 2 commits into
4.6from
IBX-12102-siteaccess-not-restored-after-fragment-sub-request
Sep 2, 2026
Merged

IBX-12102: Fixed SiteAccess context being lost after fragment sub-requests#802
tbialcz merged 2 commits into
4.6from
IBX-12102-siteaccess-not-restored-after-fragment-sub-request

Conversation

@tbialcz

@tbialcz tbialcz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12102

Description:

In Page Builder, every URL generated after a page block (or any render_esi) lost the
SiteAccess prefix, e.g. // instead of /site_fr/.

Why it happened:

  1. Each fragment sub-request overwrites the shared SiteAccess object, and nothing switched
    it back when the fragment finished. Fixed with a new kernel.finish_request listener
    that brings back the parent request's SiteAccess (same as Symfony does for its router).
  2. On top of that, the SiteAccess sent to the fragment could be serialized before the
    URIElement matcher computed its URI elements, so after deserialization the matcher
    produced //. Now the elements are computed before serialization.

Origin: (1) is as old as the SiteAccess matching layer itself; (2) came with EZP-31810
(Sep 2020), which started serializing the raw, lazily-initialized property.

For QA:

  1. Add a site_fr siteaccess (URI matching) and put
    {{ path('ibexa.url.alias', { locationId: 2 }) }} at the end of pagelayout.html.twig.
  2. Edit the home page in Page Builder for site_fr: without a block, then add a block,
    publish and edit again.
  3. Expected: the URL is always /site_fr/ (before the fix: // once a block is on the page).
  4. Regression: frontend with fragments, back office, content preview across siteaccesses.

Documentation:

None.

@tbialcz tbialcz added Bug Something isn't working Ready for review labels Aug 10, 2026
@tbialcz
tbialcz requested a review from a team August 10, 2026 05:24
@tbialcz
tbialcz force-pushed the IBX-12102-siteaccess-not-restored-after-fragment-sub-request branch 3 times, most recently from b070c59 to abce25a Compare August 10, 2026 05:32
@Steveb-p

Steveb-p commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Makes sense.

Note (to self mostly) that #798 (6.0) will need slight adjustments once this lands.

@tbialcz

tbialcz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Makes sense.

Note (to self mostly) that #798 (6.0) will need slight adjustments once this lands.

OK, once #798 lands, its stack pop does the same job, so my listener can go away on 6.0.

Comment thread tests/lib/MVC/Symfony/Component/Serializer/URIElementNormalizerTest.php Outdated
@KamilSznajdrowicz
KamilSznajdrowicz force-pushed the IBX-12102-siteaccess-not-restored-after-fragment-sub-request branch from c62673c to 79193d2 Compare August 31, 2026 12:27
@KamilSznajdrowicz
KamilSznajdrowicz force-pushed the IBX-12102-siteaccess-not-restored-after-fragment-sub-request branch from 79193d2 to 45577b3 Compare September 1, 2026 10:06
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@tbialcz
tbialcz merged commit 5cca05d into 4.6 Sep 2, 2026
35 checks passed
@tbialcz
tbialcz deleted the IBX-12102-siteaccess-not-restored-after-fragment-sub-request branch September 2, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working QA approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants