Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-25529: Remove uneeded resetting of ezpublish_legacy.kernel alias #51

Merged

Conversation

emodric
Copy link
Collaborator

@emodric emodric commented Mar 1, 2016

https://jira.ez.no/browse/EZP-25529

With Symfony 2.7.10, the following error occurs when running legacy scripts through ezpublish:legacy:script wrapper:

eddie@abyss [~/www/netgensite] ( ± master ● ● ) $ php app/console ezpublish:legacy:script bin/php/ezpgenerateautoloads.php
Running script 'bin/php/ezpgenerateautoloads.php' in eZ Publish legacy context

  [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]                                                                                                     
  You have requested a non-existent service "ezpublish_legacy.kernel". Did you mean one of these: "ezpublish_legacy.router", "ezpublish_legacy.kernel.lazy_loader", "ezpublish_  
  legacy.kernel_handler", "ezpublish_legacy.kernel_handler.cli", "ezpublish_legacy.kernel_handler.web"?                                                                          

ezpublish:legacy:script [--legacy-help] [--] <script>

The fix is quite simple:

In Symfony 2.7.0 - 2.7.9, line removed here did nothing, since ezpublish_legacy.kernel
is an alias and Container::set never did anything with aliases.

In Symfony 2.7.10, setting an alias to a new value basically converts the
alias definition to service definition, meaning that ezpublish_legacy.kernel
will not point to ezpublish_legacy.kernel.lazy any more, thus making the alias
invalid next time ezpublish_legacy.kernel.lazy is rebuilt.

See symfony/symfony#16461 for details

Manual tests only were performed. Unit tests passed locally.

@andrerom
Copy link
Contributor

andrerom commented Mar 1, 2016

+1 (was going to try to get travis to run, but unless someone has input on that on the other PR we an take that later)

@emodric
Copy link
Collaborator Author

emodric commented Mar 2, 2016

@andrerom Want me to rebase this branch when you merge #52 ?

@andrerom
Copy link
Contributor

andrerom commented Mar 2, 2016

yes, go ahead :)

In Symfony 2.7.0 - 2.7.9, this line did nothing, since `ezpublish_legacy.kernel`
is an alias and `Container::set` never did anything with aliases.

In Symfony 2.7.10, setting an alias to a new value basically converts the
alias definition to service definition, meaning that `ezpublish_legacy.kernel`
will not point to `ezpublish_legacy.kernel.lazy` any more, thus making the alias
invalid next time `ezpublish_legacy.kernel.lazy` is rebuilt.

See symfony/symfony#16461 for details
@emodric emodric force-pushed the fix_unsetting_legacy_kernel_alias branch from 87e971d to c5bf6c2 Compare March 2, 2016 10:51
@emodric
Copy link
Collaborator Author

emodric commented Mar 2, 2016

Done!

@emodric
Copy link
Collaborator Author

emodric commented Mar 2, 2016

@andrerom It seems Travis is stuck. Any help?

@andrerom
Copy link
Contributor

andrerom commented Mar 2, 2016

seems to be running now

@emodric
Copy link
Collaborator Author

emodric commented Mar 2, 2016

Thanks!

andrerom added a commit that referenced this pull request Mar 2, 2016
Remove uneeded resetting of ezpublish_legacy.kernel alias
@andrerom andrerom merged commit 6b1c9e3 into ezsystems:master Mar 2, 2016
@emodric emodric changed the title Remove uneeded resetting of ezpublish_legacy.kernel alias EZP-25529: Remove uneeded resetting of ezpublish_legacy.kernel alias Mar 2, 2016
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.

2 participants