Support » Plugin: The Events Calendar » Errorneous URLs generated for ‘Previous’ link on a localized site

  • Resolved Gabriel Cséfalvay


    Hi TEC, I ran into an issue with the URL generated for the ‘Next’ and ‘Previous’ links on the event list pages being invalid. This is an issue only when the site language is set to Slovak, set to English it’s working.

    The linked URL for ‘Previous’ looks like this:|eventsx)/(/?:list)/&eventDisplay=past

    Looks like a template does not get processed. I tracked down the problem as much as I could, to an exact function where it happens. The issue has 2 parts, I’ll describe it.

    1. Link template

    File: /wp-content/plugins/the-events-calendar/common/src/Tribe/Rewrite.php
    Line: 556
    Code: $replaced = str_replace( array_keys( $replace ), $replace, $link_template );

    At this line the variables are the following:

    array(5) {
    ["(?:month|mesiac)"]=> string(6) "mesiac"
    ["(?:list|zoznam)"]=> string(6) "zoznam"
    ["(?:today|dnes)"]=> string(4) "dnes"
    ["(?:day|den|deň|de%c5%88|DE%C5%88)"]=> string(8) "de%c5%88"
    ["(?:events|udalosti)"]=> string(8) "udalosti"
    (Note: “udalosti” is the Slovak translation of the word ‘events’.)

    $link_template: string(30) "(?:events|eventsx)/(?:list)/?$"
    (Note: “events” is the current slug, “eventsx” is the previous slug)

    Looks like the "(?:events|udalosti)" term in the array is supposed to match "(?:events|eventsx)" in the second string. The result is that the template parts do not get replaced. As I see, for this purpose the str_replace function is not the right match.

    2. The chosen slug is being translated

    I set a slug for the event calendar, and I see it being translated to the site language. This is something that should not happen.

    Thanks in advance for dealing with this. I’ll provide as much information as I can.


Viewing 1 replies (of 1 total)
  • Plugin Support Deblyn Prado


    Hey there @havierpxblck how’re you doing?

    Can you let me know which plugin are you using to translate your website?

    Recently we faced a few compatibility issues between The Events Calendar and WPML so we released some bug fixes together with their team and we believe that everything is good now.

    Would be helpful too if you can copy and paste your System Information in your next reply


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