• Resolved artiemart

    (@artiemart)


    We have been having problems with intermittent 404 errors on our sites with TEC and Polylang.
    Similar to https://www.ads-software.com/support/topic/frequent-404-errors-on-individual-events-and-unrelated-cpts/page/2/

    There seemed no logic to when the errors occurred, but after tracing we realised that they occurred when bots crawl the site with old non-existent urls, that I can only presume come from an previous out of date site map.
    Examples : /nl/researcher/wayens-benjamin/paged-2/2/
    /fr/events/2016-01-22/
    Event Calendar’s reaction to this is to fire generate_rewrite_rules. It doesn’t overwrite the rules created by Polylang (and which contain the language information (fr|nl|en) ) but it prepends a whole new set of rules to the rewrite_rules.
    I can only presume that the original polylang rules are never reached because any pages are now filter by the erroneous rules at the front.
    It would be great to have a permanent solution for this problem.

    wp-core
    version: 6.4.4

    wp-plugins-active
    Polylang Pro: version: 3.5.3, author: WP SYNTEX (latest version: 3.6.1), Mises à jour auto désactivées
    The Events Calendar: version: 6.5.0, author: The Events Calendar, Mises à jour auto désactivées

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello @artiemart,

    Thanks for getting in touch with us.

    The issue was fixed in the past. Try these workarounds:

    1. Turning off the month view cache at Events > Settings > General > Viewing and see.
    2. Use a custom function to prioritize Polylang’s rules. Add this to your functions.php
    add_action('init', function() {
        flush_rewrite_rules();
    });

    3. Try this one:

    remove_filter( 'generate_rewrite_rules', [ 'Tribe__Events__Rewrite', 'filter_generate' ] );
    remove_action( 'wp_loaded', [ 'Tribe__Events__Rewrite', 'maybe_delayed_flush_rewrite_rules' ] );

    As always, please test this first on your staging site before applying to your live site.

    I hope that helps. I am excited to hear back from you.

    Thread Starter artiemart

    (@artiemart)

    Hello @frankremmy ,

    [Corrected]
    I have just tested with the month view cache deactivated and I still have the same problem.

    Point 2 doesn’t work on it’s own, we’ve had them in place for sometime.

    Point 3.
    Sure the flush_rewrite_rules(); in admin_init help but, as many have already said it’s a DIY fix to compensate for TEC doing their job and fixing a problem. Adding the rewrite rules every time a page is called just because TEC can’t handle the occassional 404 is inefficient.

    Regards

    Plugin Support Darian

    (@d0153)

    Hi @artiemart

    Thanks for your response.

    Examples : /nl/researcher/wayens-benjamin/paged-2/2/
    /fr/events/2016-01-22/

    Could we ask for the URL of you calendar? We want to check it further on our end.

    Also, does the issue persists if you only activate the Polylang PRO and The Events Calendar?

    Looking forward to your reply.

    Thread Starter artiemart

    (@artiemart)

    Hello @d0153 Darian,

    “Also, does the issue persists if you only activate the Polylang PRO and The Events Calendar?”
    Yes.
    This is one of the sites on which it occurs. https://bsi.brussels
    Please note that we have in place a script in the ‘wp’ action which checks the position of the polylang rules and rewrites the rules if they are too far down (“A crude fix to avoid rewriting the rules at every page load, but is useful in tracing when the error occurs). So as soon as the error is detected it is repaired.

    Plugin Support Darian

    (@d0153)

    Hi @artiemart

    Thanks for your response.

    Let me check with the team about this one, and I’ll update you once I know more.

    In the meantime, please reach out to Polylang team about this issue. It’s possible that they have encountered a similar issue in the past and might be able to offer a potential workaround.

    Plugin Support Darian

    (@d0153)

    Hi @artiemart

    I just heard back from the team. Unfortunately, we could not provide help on this issue. The Polylang team developed Polylang PRO’s integration capabilities, so I recommend reaching out to their developers for additional support in this matter.

    Let us know if you have further questions or concerns.

    Thread Starter artiemart

    (@artiemart)

    Hi @d0153

    Thank you for your reply.

    However I’m not sure I see the logic of contacting the polylang support.
    As I see it The Events Calendar is executing generate_rewrite_rules() when it does not need to, which in turn breaks the rewrite rules of other plugins, and you’re suggesting I should ask the developers of the other plugins to change their code to adapt to the The Events Calendar error? I can just imagine their reply.
    Or have I misunderstood?

    Regards

    Plugin Support Darian

    (@d0153)

    Hi @artiemart

    I shared your reply to the team, and here’s what they said:

    From what I remember, Polylang Pro had an integration with TEC to make it work as expected (their version 3.1), so that’s why I usually mention that the support comes from their developers
    https://polylang.pro/downloads/polylang-pro/?changelog=1

    Let me know if you have further questions or concerns.

    Plugin Support Darian

    (@d0153)

    Hi there,

    It appears that there hasn’t been any recent activity on this thread, so we’ll consider it resolved. However, if you have any additional questions or concerns, feel free to start a new thread.

    Thread Starter artiemart

    (@artiemart)

    Hi Darian

    It is not resloved.
    I’ve just been looking at the links you sent me.
    In this issue https://github.com/polylang/polylang/pull/849 the order of the rewrite rules is at the heart of the problem.

    I presume that it comes from this line in Rewrite.php
    $wp_rewrite->rules = $this->rules + $wp_rewrite->rules;
    Which clearly places the new TEC rules infront of existing rules. And when polylang is installed is clearly risking breaking the system.

    Plugin Support Darian

    (@d0153)

    Hi @artiemart

    Thanks for your message.

    I just wanted to update you and let you know that we are still investigating this issue. At the moment, I’ve created an internal ticket [TECTRIA-106] to address this issue and I’ve included your specific use case in it to communicate it to our team.

    We prioritize bugs by taking into consideration the number of users impacted as well as how the bug impacts one’s ability to run an event/sell tickets. I don’t have a specific timeline as to when this issue will be resolved, but trust that our team is aware. Our team communicates updates and bug fixes in our newsletter and via our changelog.

    I’m happy to help if any other questions are coming up around this topic, otherwise I’ll go ahead and close this ticket.

    Thanks again for reporting this issue and for using The Events Calendar! Have a great day.

    Internal Bug Ticket Reference: TECTRIA-106

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.