Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Remove not Symfony 5 compliant service argument %kernel.root_dir% #295

Merged

Conversation

l-vo
Copy link
Contributor

@l-vo l-vo commented Oct 26, 2019

The service swiftmailer.spool.file.abstract uses %kernel.root_dir% in a path as its first argument. I think this argument is useless since it's replaced in SwiftMailerExtension.

->replaceArgument(0, sprintf('%%swiftmailer.spool.%s.file.path%%', $name))

Can anyone confirm it's not a BC break since a CompilerPass can't be registered and pass (and use this useless value) before SwiftMailerExtension code execution ?

@javiereguiluz
Copy link
Member

javiereguiluz commented Nov 6, 2019

@l-vo good catch!

@nicolas-grekas could you please check if this PR is the right fix for this issue? Thanks!

The installation of Symfony 5 is showing the following error at the moment:

$ symfony new --full --version=dev-master my_project

[...]

Script cache:clear returned with error code 1
!!
!!  In ParameterBag.php line 98:
!!
!!    The service "swiftmailer.spool.file.abstract" has a dependency
!!    on a non-existent parameter "kernel.root_dir".
!!    
!!    Did you mean one of these: "kernel.project_dir",
!!    "kernel.cache_dir", "kernel.logs_dir"?
!!

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with minor comment

Resources/config/swiftmailer.xml Show resolved Hide resolved
(removed kernel.root_dir doesn't exist anymore in Symfony 5)
@l-vo l-vo force-pushed the remove_useless_spool.file.abstract_argument branch from 21bebc8 to 3653248 Compare November 6, 2019 19:37
@l-vo
Copy link
Contributor Author

l-vo commented Nov 6, 2019

@javiereguiluz modified taking in account @nicolas-grekas comment :)

@fabpot
Copy link
Member

fabpot commented Nov 7, 2019

Thank you @l-vo.

fabpot added a commit that referenced this pull request Nov 7, 2019
…_dir% (l-vo)

This PR was merged into the 3.3-dev branch.

Discussion
----------

Remove not Symfony 5 compliant service argument %kernel.root_dir%

The service swiftmailer.spool.file.abstract uses %kernel.root_dir% in a path as its first argument. I think this argument is useless since it's replaced in `SwiftMailerExtension`. https://github.com/symfony/swiftmailer-bundle/blob/6b895bc0a5e815d1bf2d444869415a7c752516aa/DependencyInjection/SwiftmailerExtension.php#L262

Can anyone confirm it's not a BC break since a CompilerPass can't be registered and pass (and use this useless value) before `SwiftMailerExtension` code execution ?

Commits
-------

3653248 Remove useless swiftmailer.spool.file.abstract argument value
@fabpot fabpot merged commit 3653248 into symfony:master Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants