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

Does not work with new version of OctoberCMS (v40 #29

Closed
codebugs opened this issue Aug 2, 2017 · 3 comments
Closed

Does not work with new version of OctoberCMS (v40 #29

codebugs opened this issue Aug 2, 2017 · 3 comments

Comments

@codebugs
Copy link
Contributor

codebugs commented Aug 2, 2017

Hi,

I just (edge) upgraded to OctoberCMS version 420 (LTS) and now I receive the following error message regarding Twix extensions plugin:

Type error: Argument 1 passed to Twig_Extensions_Extension_Date::__construct() must implement interface Symfony\Component\Translation\TranslatorInterface or be null, instance of VojtaSvoboda\TwigExtensions\Classes\TimeDiffTranslator given, called in ...plugins\vojtasvoboda\twigextensions\Plugin.php on line 208

Regards,
CB

@Fl0Cri
Copy link

Fl0Cri commented Aug 3, 2017

Just got exactly the same problem. I had a quick look and it seems that in build 420, the October\Rain\Translation\Translator class used by VojtaSvoboda\TwigExtensions\Classes\TimeDiffTranslator has moved from the Symfony interface Symfony\Component\Translation\TranslatorInterface to the Laravel one Illuminate\Contracts\Translation\Translator (available since Laravel 5.4).

Currently, both interfaces looks the same:

So I did this to fix my v420 site in https://github.com/vojtasvoboda/oc-twigextensions-plugin/blob/master/classes/TimeDiffTranslator.php#L6:

// Current
class TimeDiffTranslator extends Translator
{}

// Fixed
use Symfony\Component\Translation\TranslatorInterface;
class TimeDiffTranslator extends Translator implements TranslatorInterface
{}

Sorry for not making a PR, I havn't time yet to test it more deeply and see if there are side-effects. However, it fixes the fatal error and should be backward compatible.

@vojtasvoboda
Copy link
Owner

Hi guys, sorry for troubles. I have made PR and now waiting for tests: #30

@vojtasvoboda
Copy link
Owner

Update 1.1.0 now ready. Please update at your backend. Thanks guys again for testing.

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

No branches or pull requests

3 participants