Skip Navigation

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.

This topic contains 18 replies, has 3 voices.

Last updated by marcU-2 4 years, 2 months ago.

Assisted by: Marcos Vinicios Barreto.

Author Posts
January 7, 2020 at 11:22 am #5246017

marcU-2

I am trying to: Open Single View of Custom Post Type "Event" in german language when I click on a post preview.

Link to a page where the issue can be seen:
hidden link

I expected to see:
For example posts in list linking to hidden link

Instead, I got:
For example the same post linking to this: hidden link

Seems like the translations of the post type slugs aren't working always. This bug appears randomly. For some period of time it works and then it just stops working and the post prewiev links lead to the wrong single URL.

To "solve" this it is enough to just login and out. After this, the links are correct for some time again. At first I thought saving the permalinks again solves this, but then I realised just loggin in make it work again. Very curious. I even compared the data in the options -> rewrite_rules tables before and after this "fix". No difference before and after loggin in.

I can't reproduce this behaviour, it just happens randomly. Maybe more often than we think, because it is not traceable in any logs.

Sometimes it seems to affect the woocommerce shop page to when the other post types throwing 404 errors. Then on the product archive page hidden link the products are not listed. Just the categories are then shown. By default both should be displayed.

January 7, 2020 at 8:38 pm #5249569

Bruno

Thank you for contacting us. About the redirect issue, I was able to see the redirect going on. Within the .htaccess file, no redirects are being made?

Ideally, we should test with a minimal environment to see if the problem will persist. Please as a test, could you disable all non-WPML plugins, switch to the default theme and see if the problem persists?

If the problem is fixed, please, enable the plugins one by one to see if there is any compatibility problem between these plugins.

Thank you.

January 9, 2020 at 9:10 am #5259789

marcU-2

Hello Bruno. Thanks for your reply. I have to replicate the site on a local machine to test the minimal environment because it is a live webshop with high traffic.

Yes there are redirects in the .htaccess but they don't seem to interfere. Especially because we have another woocommerce shop with wpml installed where the same issue appears since a period of time. And they don't have the same redirects in .htaccess. This behaviour must be introduced by an update, because both shops formerly worked well without this issue.

Today I noticed the wrong redirects again. This time the 404 on the events single views appeared and the products on the shop archive page were not shown. I had to resave the permalinks to get the page working properly again.

I extracted the data from the wp_options -> rewrite_rules table before and after flushing the permalinks. Now, there were significant differences between this states. It seems in the broken version the post-type slugs are default and not translated.

If it helps I can send you this data...

Best regards,
Bernhard

January 9, 2020 at 2:35 pm #5262625

Bruno

Hi Bernhard,

Thank you for the detailed explanation. I'll need to request temporary access (wp-admin and FTP) to your site - preferably to a test site where the problem has been replicated if possible - in order to be of better help.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Note:

*** Please, can I install the Duplicator plugin (or All in One Migration) to make a copy of your site and install it on my test environment? This will help me debug the problem.

*** Note: Please make a full backup of your site.

Privacy and Security when Providing Debug Information for Support: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Thank you.

January 10, 2020 at 11:07 pm #5271659

Bruno

Hi,

I have tried in a number of ways to install your theme, but as it has a totally different architecture than normal WordPress I could not.

If I create a test environment in cloudways (our environment testing), could you install your site in our test environment?

Thank you.

January 13, 2020 at 7:35 am #5279519

marcU-2

Hello Bruno, okay... I mean yes, it is a custom theme based on sage, also by roots.io, but if you just copy over the files it should work on a "normal" lamp stack or something like it. Or what do you mean? The whole install?

Thanks, bernhard

January 14, 2020 at 4:52 pm #5291529

Marcos Vinicios Barreto

Hello Bernhard,

Thank you for the updates, I am covering Bruno here is he is off today. I tested the provided staging website at: hidden link and couldn't notice the randomly 404 error. For example:

1 - At: hidden link I clicked to read the 'Mit allen Sinnen auf dem Rhein' post.

2 - I was redirected properly to: hidden link which should be the correct behavior.

Can you please confirm if you still see this issue from your staging environment? Thank you for your collaboration, have a nice day.

January 15, 2020 at 9:46 am #5296047

marcU-2

Would it help if I gave you the rewrite_rules data from the options table? Once during the error and once after the permalinks have been flushed and the page is working again?

Did you find any configuration errors?

January 15, 2020 at 1:50 pm #5297985

Marcos Vinicios Barreto

Hello Bernhard,

Thank you for the updates. It is really complex to debug an issue that happens randomly, in the case of not found errors (http 404 error) it might not be related to WPML, as said before it could be related to a third party plugin conflicting in your website, another cause in some cases are server related for example memory limit.

I tried to reproduce it in your staging environment but I didn't notice any issue happening, can you please confirm if you see the same issue in your staging environment, and if so, can you please record your screen while reproducing the issue? You can use this tool for this task: hidden link.

As regarding providing the rewrite_rules from the database tables it won't help as at first we need to reproduce the issue, understand it and then provide you with a solution, maybe we'll need it once it he issue is reproduced for troubleshooting purposes, but not at the first investigation process.

Thank you for your collaboration, have a nice day.

January 27, 2020 at 10:49 am #5369289

marcU-2

Hello Marcos,

thanks for your reply and sorry for the delay. I wasn't at the office for a while.
So I tried some procedures and found one that reproduces the issue. Not always but often enough to call it reproduceable.

So the wrong permalinks occur if you edit or publish an event. After this, sometimes the permalinks on the page hidden link are broken.

The weird thing is, that after some random amount of time, or if you log out and in again the error disappears. Maybe the log in and out thing is just a subjective observation because the error would also have been disappeared after this random period of time without logging out and in and it is only a coincidence.

Maybe you can reproduce it by this steps: Login > Go to CPT "Veranstaltungen" > Update or Publish a Post > Check hidden link for broken links. > Maybe Clear Wp Rocket Cache (Admin Bar)

It could be, that you have to try it a few time because of the random appearance ot the problem. Can you tell me if you can reproduce it...

I've recorded the process to reproduce the error. How can I provide the video to you? In the first half of the video I could not reproduce it but then at the second try of changing and publishing a post you can see how suddenly after clearing the cache the 404 appears on the "Veranstaltungen" Seite and then automagically corrects after logging out and in...

Thanks a lot,
Bernhard

January 28, 2020 at 7:19 pm #5380131

Marcos Vinicios Barreto

Hello,

Thank you for the updates. I tried to replicate the issue, again I couldn't reproduce it, I clicked to update several events posts, but the 404 error didn't happen. Can you please confirm if you can reproduce the issue with all the plugins disabled includind WPML? If not, please activate one by one trying to reproduce the error, as the last step activate WPML and its addons, this step will confirm if your issue is related to the WPML usage or the server environment itself.

If you have recorded the screen using the provided tool of my previous reply (hidden link) you can share the url here so I can watch it, if not, you can upload your video to Google Drive, Dropbox etc and share the download url here. Thank you for your collaboration and continued patience, have a nice day.

January 29, 2020 at 8:29 am #5382309

marcU-2

Hello Marcos,

thanks for your reply. I will test the install as you mentioned.
I've uploaded the screencast here: hidden link

January 30, 2020 at 8:30 am #5390263

marcU-2

Hi Marcos,

I investigated a bit further and at my first try I deactivated wp-rocket. And as it seems, this was the problem. I can also reproduce the error now almost every time if I do the following steps. Login > Go to the "Veranstaltungen" Page (Frontend) > Click on "Clear Cache > All languages" in the Wp Rocket dropdown menu. Than the links on the page are broken, because the post type slug is than "event" and not translated to "veranstaltungen". To solve the problem you could just clear the german wp-rocket cache, but sometimes it also reverts itself autoimagically. Is this maybe some compatibility issue between wp-rocket and wpml?

January 30, 2020 at 2:47 pm #5393159

Marcos Vinicios Barreto

Hello,

Thank you for the updates. I'm still not able to reproduce the issue even trying your instructions regarding WP Rocket cache. In any case I noticed you are running outdated versions of WPML, please, let's try the following:

1 - Make sure your WPML plugins are updated to their latest versions.

2 - Disable all the plugins except WPML and WP Rocket and the ones your theme depends on and try to replicate the issue.

If the issue persists even so, then we'll recreate it in a clean sandbox test install and forward it to our second level support. Please, let me know the results, have a nice day.

January 31, 2020 at 9:53 am #5397917

marcU-2

Hi Marcos,

thanks for your reply. Curious, I can reproduce it almost every time. It is crucial that you clear the cache at the frontend from the wp-rocket dropdown on the "veranstaltungen" page. And after this, just copy the url and open it in an private browser window. Don't change back to the backend or do any other action. Seems that performing any action in the backend or logging in/out reverts the error. So if you just login, navigate to "Veranstaltungen" in the front end, click "clear cache > all languages" from the wp-rocket admin-bar dropdown and then open the "Veranstaltungen" page in a new private tab (like a user would see it), you should be able to reproduce it.

Anyway I've update all wpml components and wp-rocket as well as disabled all plugins not necessary. Just beaverbuilder+addon, woocommerce+wishlist and acf are active now next to wpml and wp-rocket. Still, same behavior. Maybe it's the way we registered the post type or something like that what produces the problem between wpml and wp-rocket?!

Best regards,
Bernhard

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.