Skip to content

IBX-12204: Read current SiteAccess via SiteAccessServiceInterface - #191

Draft
Steveb-p wants to merge 1 commit into
6.0from
IBX-12204-siteaccessservice-scope-stack
Draft

IBX-12204: Read current SiteAccess via SiteAccessServiceInterface#191
Steveb-p wants to merge 1 commit into
6.0from
IBX-12204-siteaccessservice-scope-stack

Conversation

@Steveb-p

@Steveb-p Steveb-p commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12204

Related PRs:

Description:

ibexa/core's #798 (IBX-12204) refactors SiteAccessService so it no longer relies on the legacy, shared, container-wide Ibexa\Core\MVC\Symfony\SiteAccess singleton service. As part of that, Ibexa\Bundle\Core\EventListener\ConsoleCommandListener stops mutating that shared singleton in place on every console command run — it now only calls SiteAccessService::changeSiteAccess() with a freshly-constructed SiteAccess.

TestSiteaccessCommand (ibexa:behat:test-siteaccess) type-hinted that shared singleton directly to print the CLI-resolved siteaccess name, so it broke: it now always prints the singleton's boot-time placeholder value instead of the real one. This is exercised by ibexa/core's own src/bundle/Core/Features/Console/console.feature scenario "Commands use the default siteaccess if not specified" (currently tagged @broken on the core PR pending this fix).

Fix: inject SiteAccessServiceInterface instead and read the current SiteAccess via getCurrent().

For QA:

Once this PR and ibexa/core#798 are both available, running bin/console ibexa:behat:test-siteaccess (with or without --siteaccess=<name>) should print the resolved siteaccess name, matching the two console.feature scenarios in ibexa/core.

Documentation:

None needed — internal Behat test fixture.

TestSiteaccessCommand used to type-hint the shared, container-wide
Ibexa\Core\MVC\Symfony\SiteAccess singleton directly to print the
CLI-resolved siteaccess name. ibexa/core's ConsoleCommandListener no longer
mutates that singleton in place (see ibexa/core#798, IBX-12204) — it only
calls SiteAccessService::changeSiteAccess() with a freshly-constructed
SiteAccess — so this command now needs to read the current SiteAccess via
SiteAccessServiceInterface::getCurrent() instead.
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Steveb-p added a commit to ibexa/core that referenced this pull request Aug 7, 2026
Points Behat CI at the branch that fixes TestSiteaccessCommand, so this
PR's "Commands use the default siteaccess if not specified" scenario can
run and pass before that companion PR merges. Must be removed before
merging this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants