{"id":23611,"date":"2012-08-13T15:35:06","date_gmt":"2012-08-13T22:35:06","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/"},"modified":"2012-08-13T15:35:06","modified_gmt":"2012-08-13T22:35:06","slug":"tec-wpml-issue-page-not-found-errors","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/","title":{"rendered":"TEC, WPML issue &#8212; page not found errors"},"content":{"rendered":"<p>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 &#8220;page not found&#8221; error is the result.  There are a number of threads on here that discuss similar problems, but I haven&#8217;t really found any solutions.  I think I can add some information to the mix.<\/p>\n<p>These are three other seemingly related threads:<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"XTQzNvT7HC\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/the-view-all-events-and-past-events-break-after-a-while\/\">The &#039;View all Events&#039; and &#039;Past Events&#039; break after a while<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;The &#039;View all Events&#039; and &#039;Past Events&#039; break after a while&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/the-view-all-events-and-past-events-break-after-a-while\/embed\/#?secret=ceZdsMsVDV#?secret=XTQzNvT7HC\" data-secret=\"XTQzNvT7HC\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"T8FML0GRj3\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/the-events-calendar-pro-and-wpml\/\">The Events Calendar PRO and WPML<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;The Events Calendar PRO and WPML&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/the-events-calendar-pro-and-wpml\/embed\/#?secret=lNLMPSjown#?secret=T8FML0GRj3\" data-secret=\"T8FML0GRj3\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"GdmpEzAfFT\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/links-messed-up-with-italian-language-3\/\">Links messed up with italian language<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Links messed up with italian language&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/links-messed-up-with-italian-language-3\/embed\/#?secret=pktRzMRgaC#?secret=GdmpEzAfFT\" data-secret=\"GdmpEzAfFT\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>On the site I&#8217;m working on, there are three languages present &#8212; English (default), Spanish (es) and Portuguese (pt-pt).  The events section is only in English &#8212; 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.<\/p>\n<p>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.<\/p>\n<p>This is what &#8220;past events&#8221; rules look like after switching to Portuguese:<\/p>\n<p>pt-pt\/events\/past\/page\/(\\d+)\tindex.php?post_type=tribe_events&amp;eventDisplay=past&amp;paged=$matches[1]<br \/>\npt-pt\/events\/past\tindex.php?post_type=tribe_events&amp;eventDisplay=past<\/p>\n<p>After switching to Portuguese and then back to English (THESE WORK):<\/p>\n<p>events\/past\/page\/(\\d+)\tindex.php?post_type=tribe_events&amp;eventDisplay=past&amp;paged=$matches[1]<br \/>\nevents\/past\tindex.php?post_type=tribe_events&amp;eventDisplay=past<\/p>\n<p>After switching to Spanish:<\/p>\n<p>es\/events\/realizado\/page\/(\\d+)\tindex.php?post_type=tribe_events&amp;eventDisplay=past&amp;paged=$matches[1]<br \/>\nes\/events\/realizado\tindex.php?post_type=tribe_events&amp;eventDisplay=past<\/p>\n<p>After switching to Spanish and then back to English (THESE CAUSE ERRORS):<\/p>\n<p>events\/realizado\/page\/(\\d+)\tindex.php?post_type=tribe_events&amp;eventDisplay=past&amp;paged=$matches[1]<br \/>\nevents\/realizado\tindex.php?post_type=tribe_events&amp;eventDisplay=past<\/p>\n<p>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&#8217;s really just a temporary workaround, as the file will be replaced with the next plugin update.  I&#8217;d like something a bit more permanent.<\/p>\n<p>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.<\/p>\n<p>I have tried adjusting settings in the WPML config to ensure that events-related posts and taxonomies are not translated, but that didn&#8217;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.<\/p>\n<p>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?<\/p>\n","protected":false},"template":"","class_list":["post-23611","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TEC, WPML issue - page not found errors -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TEC, WPML issue - page not found errors -\" \/>\n<meta property=\"og:description\" content=\"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 &#8220;page not found&#8221; error is the result. There are a number of threads on here that discuss similar problems, but [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/\",\"name\":\"TEC, WPML issue - page not found errors -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2012-08-13T22:35:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"TEC, WPML issue &#8212; page not found errors\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TEC, WPML issue - page not found errors -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/","og_locale":"en_US","og_type":"article","og_title":"TEC, WPML issue - page not found errors -","og_description":"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 &#8220;page not found&#8221; error is the result. There are a number of threads on here that discuss similar problems, but [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/","name":"TEC, WPML issue - page not found errors -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2012-08-13T22:35:06+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tec-wpml-issue-page-not-found-errors\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"TEC, WPML issue &#8212; page not found errors"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/23611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/23611\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=23611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}