• Resolved bearstar

    (@bearstar)


    The recent update to Shield Simple Firewall resulted in this error when your plugin and shield are running together:

    An error of type E_ERROR was caused in line 78 of the file /public_html/wp-content/plugins/wp-rss-aggregator/vendor/symfony/translation/Translator.php. Error message: Uncaught TypeError: Symfony\Component\Translation\Translator::__construct(): Argument #2 ($selector) must be of type ?Symfony\Component\Translation\MessageSelector, Carbon\MessageFormatter\MessageFormatterMapper given, called in /public_html/wp-content/plugins/wp-simple-firewall/src/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php on line 87 and defined in /public_html/wp-content/plugins/wp-rss-aggregator/vendor/symfony/translation/Translator.php:78

    If you run each separately, they are fine. I have also reported this on the Shield forum.

Viewing 4 replies - 1 through 4 (of 4 total)
  • @bearstar thanks for bringing this to our attention. I have shared the same with the internal team for further investigation.

    Hey @bearstar I wanted to touch base and confirm that WP Resource Aggregator uses the?symfony/translation?library version 2.* feature in its templates. Specifically, it uses the library to localize the “time ago” dates into the proper language.

    The plugin will be moving away from the library in the next major version however in the meantime If you are not using any of the translations or not using the “Use time ago format” feature, then you can “remove” the library from WPRA by editing its code like so:

    1. Open the file wp-rss-aggregator/src/Modules/TwigModule.php
    2. Find the Twig date extension on line 132. It should look this:
    'wpra/twig/extensions/date' => function (ContainerInterface $c) { return new DateExtension(new TwigDateTranslator()); },
    1. Remove the translator from the date extension by changing the line inside the function to this:
    return new DateExtension();
    1. Save the file.
    2. Rename the folder at wp-rss-aggregator/vendor/symfony/translation to something else.

    I hope this helps and do let me know if something is unclear.

    @bearstar as a quick follow-up, I received an update from the team and in the next release, you should have an option to remove dependency to use the updated version by adding the following filter.

    add_filter('wpra/twig/use_translations', '__return_false');
    Thread Starter bearstar

    (@bearstar)

    Thank you for that solution!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conflict with Shield Plugin’ is closed to new replies.