This thread is resolved. Here is a description of the problem and solution.
Problem:
getting some random 404 pages trying to access to the events in the secondary language.
Solution:
The TEC adds the option to translate the slug of the events as an admin string. However, this is not the correct way of doing this. The value should be translated from the post type translation of the slug in WPML > Settings > CPT Translation > Set different slugs in different languages for Events.
Once you MATCH the values there - then it works.
Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/translating-page-slugs/
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Bug, Compatibility
This topic contains 11 replies, has 2 voices.
Last updated by Waqas Bin Hasan 1 year, 10 months ago.
Assisted by: Waqas Bin Hasan.
Author | Posts |
---|---|
April 12, 2023 at 8:31 am #13453005 | |
daniL |
Hi, I am getting some random 404 pages trying to access to the events in the secondary language. hidden link hidden link Sometimes the event load and if you refresh, it loads the 404. |
April 12, 2023 at 7:09 pm #13459145 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for contacting the support. We've something reported already but no exactly the same. However, can you try the solution mentioned in this errata https://wpml.org/errata/the-events-calendar-fatal-error-on-translated-events-with-php-8/ ? IMPORTANT: Take full backup of your website and database beforehand. It is highly advised to try the following on a staging/dev site first, so your live website isn't compromised. If that doesn't help, enable debugging on your site. See https://wpml.org/documentation/support/debugging-wpml/ for details. Once enabled, browse the WordPress admin pages (random), frontend website and the said sections/pages a few times. This will log the errors in the debug.log file which you can upload somewhere and share the download link for investigation. Further, I see that you are using WP 6.1.1, since you are using latest WPML plugins, I suggest updating WP to the latest version as well and then check for the issue. Additionally, you can also try the followings: - Deactivate all plugins except WPML, its addons and the plugin in question and check for the issue. Please let me know if this helps resolve the issue. Or I'll try my best to further assist you on the matter. Regards. |
April 17, 2023 at 1:39 pm #13488295 | |
daniL |
Hi Waqas, Tryied the solution in https://wpml.org/errata/the-events-calendar-fatal-error-on-translated-events-with-php-8/ but not lucky. I continue with your instructions and keep you informated Thanks a lot, |
April 17, 2023 at 5:38 pm #13489879 | |
daniL |
Hi again Waqas, I have working all day long testing the problem and I think I have made some steps forward. As you suggested, I have test the site using the "Twenty Twenty-Three" theme and the indispensable plugins (WPML suite + The Events Calendar), but the issue appears again (the translated events link to a 404 page, apparently randomly). Checking the server live logs, there is one error that appears: "AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace." This is my supposition: usualy the translated event url works fine on the first (and sometimes second) click, but the machine "gets exhausted" due to those many redirects. Then, more or les half a minute later (letting the server rest for a while), if you try again, the translated event loads correctly. If you reload the url, normaly the 404 appear again. The web is running on a dedicated server with 2048M ram assigned to this website (not a ram cuantity problem). If you navigate the site spacing the time between when you click on the translated events, the translated event load pefectly. I hope this data can help you find a solution. Thanks a lot for your efforts. Dani |
April 17, 2023 at 7:07 pm #13490401 | |
daniL |
Hi! If you try to click in the translated event, youll get a 404: Thanks again, Waqas! |
April 17, 2023 at 8:08 pm #13490643 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for the updates. I am working on this and 'll get back to you as soon as I find something or have a solution. Regards. |
April 18, 2023 at 5:31 pm #13498619 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for your patience and cooperation. I was able to identify the issue and find a temporary fix. The issue is due to a subpart in Default Locale which is shared among both languages (Spanish and Basque - see screenshot): - Spanish -> es_ES I added a couple of more languages for testing which however worked just fine. I then, changed default locale for Basque to just "eu" (without quote marks) and saved. After that the translated version was loading just fine. I also tested by creating new events in the sandbox site. So for now, I can offer following temporary solution: Remember to take full backup of site and database beforehand. - Go to WPML -> Languages -> Edit languages After that this should work fine. However, there may be a "too many redirects" issue when you try to access a translated version of an event. But upon reloading it 'll start loading just fine. For new events, there'll be no such problem. If you have too many events, you can try to resolve the "too many redirects" by going to: - WPML -> Support -> Troubleshooting I've also escalated the issue to the 2nd tier for a detailed review. I'll update you as soon as I hear back. In the meanwhile, if you want to try the above mentioned solution, please go ahead and let me know. Regards. |
April 19, 2023 at 3:45 pm #13506193 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Just another update I received from the team and this is more proper way instead of the previously suggested (temporary solution). You don't need to change the default locale in WPML Languages, but simply: 1) go to WPML -> Settings -> Post Types Translation After that this should work fine. However, there may be a "too many redirects" issue when you try to access a translated version of an event. But upon reloading it 'll start loading just fine. For new events, there'll be no such problem. If you have too many events, you can try to resolve the "too many redirects" by going to: - WPML -> Support -> Troubleshooting You can experience this in the sandbox site and then can apply in your own site as necessary. Please let me know how it goes for you. Regards. |
April 19, 2023 at 5:08 pm #13507045 | |
daniL |
Hi Waqas, I was unable to work in the issue until now. So I have started with the second solution. I already had different slugs defined for the two languages, so I couldn't change anything there. I have saved the permalinks but it has not worked. I have cleared the WPML cache and selected the language information and waited for it to finish. But it didn't work, the error continued. I was very sad, but I have tried the temporary solution that you had told me before. I have changed the Basque locale to eu and saved permalinks. And the trick has worked, it loads everything without problem, like until a few weeks ago 🙂 Now I have to ask you what is wrong with this solution, what is wrong with keeping a locale eu instead of es_eu. Thank you very much for the effort everyone, this problem has had me very worried. Dani |
April 19, 2023 at 6:15 pm #13507349 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for the updates. There's no issue with the temporary solution, but since those values are set by default, it is better to go for a more proper solution. However, since WPML allows editing those locales, people use as per their requirements. So in short, there's no issue and it should work just fine. For changing the different slugs, are you sure you edited those by hand? Why I am asking this, because when you expand that area it has by default some placeholders like "evento @eu" (same slug for all langs and language code) in the end. If you click in the box and start typing, that vanishes. Since I also noticed that both ES and EU translations have "evento" in the slug (on frontend), I thought you might have not defined them differently but relying on the default. As our 2nd tier team analyzed the problem: > The TEC adds the option to translate the slug of the events as an admin string. However, this is not the correct way of doing this. The value should be translated from the post type translation of the slug in WPML > Settings > CPT Translation > Set different slugs in different languages for Events. Once you MATCH the values there - then it works. Anyways, its good that one of the solutions worked fine and issue is resolved for now. Regards. |
April 24, 2023 at 1:53 pm #13527839 | |
daniL |
Thanks a lot, Waqas and the rest of stuff! |
April 26, 2023 at 7:46 am #13538575 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for your kind words, patience and cooperation. Glad that we were able to resolve the problem. This ticket is close as resolved. Please feel free to open a new one, whenever you need help relating WPML. Have a great day 🙂 |