• Resolved wadih

    (@wadih)


    Hi,

    The error just started now, getting this:

    Une erreur de type E_COMPILE_ERROR a été causée dans la ligne 331 du fichier /var/www/xxxxxxxxxxx.com/wp-content/plugins/matomo/app/vendor/twig/twig/src/Extension/CoreExtension.php. Message d’erreur : Cannot redeclare twig_cycle() (previously declared in /var/www/xxxxxxxxxxx.com/wp-content/plugins/sitepress-multilingual-cms/vendor/twig/twig/lib/Twig/Extension/Core.php:288)

    Looks like it’s conflicting with twig’s usage in WPML, which indeed is an older version, however I can’t rush upgrading WPML because it’s always a hit or miss when you update WPML. But was hoping to use Matomo in the meantime.

    I’m wondering, is it a common thing that plugin authors use the global namespace for their dependencies? Why not isolate the namespaces so that these types of issues don’t happen?

    I’m a big fan of matomo, love the plugin.

    Thanks,
    Wadih

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Thomas

    (@tsteur)

    Hi @wadih

    thanks for creating this issue. As far as a I know the issue is fixed in the latest WPML release. In case you have a testing or staging environment it may be good to test a newer version to see if the update works for you. Hoping it’s a hit rather than a miss. There’s no other workaround unfortunately.

    We generally have an issue for isolating namespaces in https://github.com/matomo-org/wp-matomo/issues/233 but it’s unfortunately not trivial and we’ll aim to do this as part of the Matomo 5 release. We can’t do this any earlier as it would be breaking APIs for Matomo plugins.

    Thanks for your understanding. I’ll mark this for now as resolved as we heard from other users that the latest update fixes the issues but feel free to comment should you run into any issues after giving their update a try. Hope this helps @wadih

    Unfortanately I have to confirm it doesn’t seem to be resolved by WPML. I’m new to Matomo and I get the same error.
    I am using the latest version of WPML + addons. Deactivating these made the issue go away, but that is not an option.

    Hope it can be resolved.
    Thanks, Leo

    Plugin Author Thomas

    (@tsteur)

    Thanks for the feedback @stickypixels . Could you maybe check if the issue is maybe with a specific WPML addon? As it last time worked for me without an issue. Or maybe could you let me know what exact error you are getting? I assume with “same error” you mean the same error as in the initial post?

    Thread Starter wadih

    (@wadih)

    It’s working for me now after the WPML updates. Here are my WPML versions:

    WPML Multilingual CMS 4.4.10
    String Translation 3.1.8
    Translation Management 2.10.6
    Yoast SEO Multilingual 1.3.0
    Sticky Links 1.5.4

    And Matomo: 4.2.0

    Plugin Author Thomas

    (@tsteur)

    Great, glad to hear it works now @wadih

    I’m sorry, my bac: reading @wadih’s reply I realised I don’t have the latest WPML versions installed. For some reason my WordPress install doesn’t show update notifications for WPML.

    I will update the lot and run some tests.
    Sorry again for the misunderstanding.
    Cheers, Leo

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Cannot redeclare twig_cycle()’ is closed to new replies.