Skip to content

Fix Mautic 6 compatibility: replace SessionInterface with RequestStack#18

Open
BuggerSee wants to merge 1 commit intoLeuchtfeuer:mautic5from
BuggerSee:mautic6
Open

Fix Mautic 6 compatibility: replace SessionInterface with RequestStack#18
BuggerSee wants to merge 1 commit intoLeuchtfeuer:mautic5from
BuggerSee:mautic6

Conversation

@BuggerSee
Copy link

Summary

  • Replace deprecated SessionInterface autowiring with RequestStack::getSession() in two services
  • Fixes Mautic 6 (Symfony 6.x) where SessionInterface is excluded from autowiring

Changes

  • Service/DoiSkippedSubmitActionHandler.php: SessionInterfaceRequestStack
  • Service/FormDoiActionSessionManager.php: SessionInterfaceRequestStack

Context

Mautic 6 uses Symfony 6.x which removed SessionInterface from autowiring (deprecated in Symfony 5.3, removed in 6.0). This causes a fatal error on cache:clear and breaks all form functionality when the plugin is installed.

The fix uses RequestStack::getSession() which is available since Symfony 5.3, so it is backwards compatible with both Mautic 5 and 6.

Reference: https://symfony.com/blog/new-in-symfony-5-3-session-service-deprecation

SessionInterface has been excluded from autowiring in Symfony 6.x.
Use RequestStack::getSession() instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant