Skip to content

[Bug] Fix Symfony env var tracking for mercure_settings in prepend()#1805

Open
vrobert78 wants to merge 1 commit intopimcore:2026.xfrom
vrobert78:fix/mercure-jwt-cookie-host-env-var-tracking
Open

[Bug] Fix Symfony env var tracking for mercure_settings in prepend()#1805
vrobert78 wants to merge 1 commit intopimcore:2026.xfrom
vrobert78:fix/mercure-jwt-cookie-host-env-var-tracking

Conversation

@vrobert78
Copy link
Copy Markdown
Contributor

Problem

In PimcoreStudioBackendExtension::prepend(), the mercure_settings container parameters were being set using $containerConfig obtained from ConfigurationHelper::getConfigNodeFromSymfonyTree(). That helper internally calls resolveValue(), which strips %env(X)% references down to plain strings.

As a result, Symfony's container compiler never sees these as proper env var parameter references, and reports env vars like MERCURE_JWT_COOKIE_HOST as "never used" — even when correctly referenced in mercure_settings configuration — causing a deployment failure.

Fix

Replace the use of $containerConfig in the mercure_settings loop inside prepend() with a fresh call to $this->processConfiguration(), which preserves %env(X)% placeholders as proper DI parameter references that Symfony can track through compilation.

Test

Verified on Upsun (Platform.sh Flex) with MERCURE_JWT_COOKIE_HOST set via env var: container compiles cleanly with no "never used" warning and the env var is correctly resolved at runtime.

🤖 Generated with Claude Code

In PimcoreStudioBackendExtension::prepend(), the mercure_settings
parameters were set using $containerConfig from
getConfigNodeFromSymfonyTree(), which internally calls resolveValue().
This strips %env(X)% references to plain strings, causing Symfony's
container compiler to report env vars like MERCURE_JWT_COOKIE_HOST as
"never used" even when correctly referenced in mercure_settings config.

Fix: call $this->processConfiguration() directly in prepend() so that
env var placeholders are preserved as proper DI parameter references.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 1 medium

Results:
1 new issue

Category Results
UnusedCode 1 medium

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant