TEC, WPML issue — page not found errors

Home Forums Calendar Products Events Calendar PRO TEC, WPML issue — page not found errors

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #23611
    Brian
    Participant

    I am running into an issue with TEC that occurs due to the use of WPML on the same site. Specifically, when visiting the past events page, the calendar page, or event category pages, a “page not found” error is the result. There are a number of threads on here that discuss similar problems, but I haven’t really found any solutions. I think I can add some information to the mix.

    These are three other seemingly related threads:

    The 'View all Events' and 'Past Events' break after a while

    The Events Calendar PRO and WPML

    Links messed up with italian language

    On the site I’m working on, there are three languages present — English (default), Spanish (es) and Portuguese (pt-pt). The events section is only in English — the events are not being translated. If I visit the past events page after viewing any page in Spanish, I get the page not found error. However, if I visit the past events page after viewing any page in Portuguese however, the page renders correctly.

    After doing a little digging, the problem seems to be related to the rewrite rules. I have added some debug code to the pages to see the current rewrite rules when the page is rendered. With this I can see that the URLs in the rules for the problem pages are being translated to Spanish. They are not being translated to Portuguese. Important to note is that there is a Spanish language file as part of the TEC plugin, but not a Portuguese (Portugal) file.

    This is what “past events” rules look like after switching to Portuguese:

    pt-pt/events/past/page/(\d+) index.php?post_type=tribe_events&eventDisplay=past&paged=$matches[1]
    pt-pt/events/past index.php?post_type=tribe_events&eventDisplay=past

    After switching to Portuguese and then back to English (THESE WORK):

    events/past/page/(\d+) index.php?post_type=tribe_events&eventDisplay=past&paged=$matches[1]
    events/past index.php?post_type=tribe_events&eventDisplay=past

    After switching to Spanish:

    es/events/realizado/page/(\d+) index.php?post_type=tribe_events&eventDisplay=past&paged=$matches[1]
    es/events/realizado index.php?post_type=tribe_events&eventDisplay=past

    After switching to Spanish and then back to English (THESE CAUSE ERRORS):

    events/realizado/page/(\d+) index.php?post_type=tribe_events&eventDisplay=past&paged=$matches[1]
    events/realizado index.php?post_type=tribe_events&eventDisplay=past

    Removing the Spanish language file from the plugins/the-event-calendar/lang directory gets around the issue (in my case), meaning that all of the pages will render out as expected. But of course, that’s really just a temporary workaround, as the file will be replaced with the next plugin update. I’d like something a bit more permanent.

    The fact that removing the TEC-specific language file makes everything work as expected (in my scenario), leads me to believe that this is an issue within TEC. That said, the only way for me to cause it to occur is to use WPML to switch languages. Also, other rules are not being translated, only those belonging to TEC.

    I have tried adjusting settings in the WPML config to ensure that events-related posts and taxonomies are not translated, but that didn’t have any effect. I have also re-saved permalinks settings, TEC settings, etc. per the other threads. The suggestion to flush the rewrite rules by adding code to the functions.php file (the third link from above), worked great, as long as the code was in the file. As soon as it was removed, the problem resurfaced when I followed the steps taken above.

    It sounds like the 2.1 release will help to address the conflicts between TEC and WPML. In the meantime, how do I nail down the root of this problem and get a more permanent fix in place?

    #23634
    Barry
    Member

    Hi Brian. We’re aware of some issues (such as those you linked to) involving WPML and I’ve asked Daniel, from the development team, to take another look at this.

    As soon as he provides some feedback I will do my best to update you. You might also want to keep an eye on this thread (which you’ve already seen) in case an update is posted there:

    The Events Calendar PRO and WPML

    Thanks!

    #23725
    Barry
    Member

    … Just to add, this might take a little while, I can’t really guarantee a quick answer for this one.

    #23748
    Brian
    Participant

    No worries, Barry. I have a workaround in place. I just have to remember to re-apply it through updates, and hope that the multi-lingual section on the site doesn’t expand to include the events. I know you were already working on this area of the code, so my post was more about sharing some new information with you guys than it was about getting an immediate fix.

    Thanks!

    #23768
    Barry
    Member

    Sure – that’s appreciated 🙂

    #24631
    Barry
    Member

    Rather than duplicate topics I’ll close this one and any further comments (or feedback from our devs) can be handled here instead: https://theeventscalendar.com/support/forums/topic/the-events-calendar-pro-and-wpml/

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘TEC, WPML issue — page not found errors’ is closed to new replies.