php-translation / symfony-bundle

Symfony integration for Translations
MIT License
327 stars 94 forks source link

Bug: Call to a member function hasSession() on null #484

Closed boksie closed 1 year ago

boksie commented 1 year ago

Hello,

During the warming up cache of the Symfony bin/console cache:clear command, i'm getting the following error:

In Activator.php line 56:

  [Error]                                         
  Call to a member function hasSession() on null 

The problem here is that the cache:clear is warming up the cache and calls the getSession from Activator.php, but there is no current request in the request stack. Possible fix is to add a null check for getCurrentRequest in the Activator.php line 56.

bocharsky-bw commented 1 year ago

Are you on the latest version of this bundle? I see we have a null check for getCurrentRequest() on this line: https://github.com/php-translation/symfony-bundle/blob/4051a5be9154614807ef2e819a7fcc169dda1392/EditInPlace/Activator.php#L57

boksie commented 1 year ago

Thank you for your quick response, I have the latest version, but I see that in the latest tag 0.12.7 the change is not yet included. Can you set a new tag on the bundle?

bocharsky-bw commented 1 year ago

I prepared a release in #485

bocharsky-bw commented 1 year ago

Thank you for reporting it!

Here's the new release: https://github.com/php-translation/symfony-bundle/releases/tag/0.12.8