Skip to content

fix: avoid session flash during console install#46

Merged
jaymeh merged 1 commit into
creode:4.xfrom
boboldehampsink:fix/console-install-session
Apr 28, 2026
Merged

fix: avoid session flash during console install#46
jaymeh merged 1 commit into
creode:4.xfrom
boboldehampsink:fix/console-install-session

Conversation

@boboldehampsink
Copy link
Copy Markdown
Contributor

Summary

  • avoid starting a web session from the plugin install handler during console installs
  • log the Pro edition requirement as a warning for console requests while keeping the existing CP flash for web requests

Context

When Craft installs plugins from project config in a console command, migration output may already have been sent before EVENT_AFTER_INSTALL_PLUGIN fires. Calling Craft::$app->session->setError() in that path can trigger session_name(): Session name cannot be changed after headers have already been sent and abort installation.

@jaymeh
Copy link
Copy Markdown
Contributor

jaymeh commented Apr 28, 2026

Hi @boboldehampsink ,

Thanks for your contribution here, I can't see any issues with the code you have committed. The only thing to note is that we use a Conventional Commits workflow, tied to our release cycle. We therefore require any PR's/Commits to be tacked with the relevant structure to build our changelog.

In your case just putting fix: in front of your commit message and PR would satisfy this requirement and we can get things merged.

You can find more about conventional commits here: https://www.conventionalcommits.org/en/v1.0.0/

@boboldehampsink boboldehampsink changed the title Avoid session flash during console install fix: avoid session flash during console install Apr 28, 2026
@boboldehampsink boboldehampsink force-pushed the fix/console-install-session branch from 578e497 to b489dde Compare April 28, 2026 10:44
@jaymeh jaymeh merged commit 9dabba8 into creode:4.x Apr 28, 2026
1 check passed
@jaymeh
Copy link
Copy Markdown
Contributor

jaymeh commented Apr 28, 2026

Thanks again @boboldehampsink. This code is now published and available in release v4.3.3.

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.

2 participants