Cornerstone 4.0.4 conflict with WPML

Hi there,

I just updated to Cornerstone 4.0.4, along with Xtheme 7.0.4. I had updated WPML to 4.2.9 but Cornerstone preview started glitching so I came onto the forum here and found this thread: https://theme.co/apex/forum/t/error-after-latest-update/64937/4

As per the suggestion in the thread, I downgraded to:
WPML Multilingual CMS - 4.0.6
WPML String Translation - 2.8.6
WPML Translation Management - 2.6.7
(because I use Yoast)

I cleared my cache, reloaded, and I’m still getting the “preview could not load” message and my developer console is showing a whole bunch of errors.

One out of the three languages is loading ok but the other two are not. Help?

I’ll include login info in a secure note. Thanks!

Hi @coracle,

The error is coming from the content of Theme Options > Global JS:

You got CSS in there which is causing errors. I move the CSS too Theme Options > Global CSS
There’s also a script tag which is not needed. I remove the script tag. This remove most of JS errors.

For homepage, I can confirm english translation is still not loading. I am getting 404 not found. Can you try to duplicate your homepage default language and then translate it again? WPML has a previous issue where it link different URL on translation. Check if the issue will be fixed.

Hi @Lely,

Thank you for your help. I tried creating a new page to duplicate the home page and making new translations but aside from default language, Cornerstone cannot load the previews. I’m getting a 400 (bad request) error now. It’s the same on the existing pages.

Hello @coracle,

How did you duplicated the page? I created a test page and even edited some of your page and Cornerstone is loading fine on my end.

To duplicate the home page created in Cornerstone, you must do this:
1.) Open the Homepage in Cornerstone
2.) In the Layout tab, save the page as a template.
3.) Go to Pages > Add New and create your new page.
4.) Edit your new page in Cornerstone.
5.) While editing the new page in Cornerstone, go to Layout tab and then load the template that you have saved.
6.) Make your changes added and hit the save button in Cornerstone.

Hope this helps.

Hi @RueNel,

Thanks for the instructions on duplicating the page. That’s exactly how I did it. Cornerstone works fine in the default language. Cornerstone doesn’t work in translated languages. Once I click on the little flags on the bottom right-hand corner to access translated pages, I get the preview not loading error (404 page not found when I check the console). If I create a brand new page, I can put new content into a translation only if I copy existing content from default language (the page I just created). If I select “start blank” the preview doesn’t load.

I was able do a workaround with Cornerstone for the Home page by creating a new page in default language and then copying the content into translated pages, deleting all the copied content and then loading the templates from the original translated home pages.

I sure hope I don’t need to do this with every single existing page just to get Cornerstone to work!! When I first installed Xtheme and WPML (before the most recent update), I had to downgrade WPML and that’s how I got the site built. I thought the updates were supposed to fix incompatibility issues. After this recent update, I’ve had to downgrade WPML again and it’s even worse. :confused:

Hey @coracle,

I checked the Home Test page and I saw that it has been translated using WPML’s Translation Management.

I’m not sure exactly how it got created by WPML but I’ve deleted the translated page.

The Home Test Simplified version now works in Cornerstone.

Please try translating the British version using the translation flag within Cornerstone.

Regarding the latest update of X/Cornerstone and Pro, they did include fixes for WPML issues. I have the latest WPML version in my test site and I don’t have translation problems.

Thanks.

Hi @christian_y,

Thanks so much for doing further investigation.
Reading your note about the current versions being fixed and working, I’ve updated to all the current versions since WPML released an update since I first posted. But I’m still getting the same problem…

Here’s what I did:

  1. Opened up Home Test in Cornerstone in default language (it worked)
  2. Clicked on the simplified flag and checked that it would load (it worked)
  3. Clicked on British flag to create the english translation
  4. Selected “Start blank”
  5. Got the preview could not load error (same as before, 400 Bad Request error if I check the console)

Guessing from your screenshots, I tried deleting the newly made english Home Test page by going to English pages in my dashboard and clicking “Trash” (I’m assuming that’s the same as your “move to recycle bin”) but when I go back to Home Test and click on the British flag, it still looks for the translated page and gives me the preview could not load error (when I’d expect it to ask me to create a new translation…). Could you please tell me how you deleted the Home Test (Simplified) page?

Then I tried:

  • creating another Test page in default language and populating it in Cornerstone
  • clicking on the (now missing) Simplified flag
  • creating Simplified translation, selecting “start blank” and getting preview error
  • clicking on British flag
  • creating English translation, selecting “copy from existing page” and preview worked

Last thing: since updating it all, the flag icons for both Traditional and Simplified Chinese disappeared. Not sure how to fix that?

Thanks for all your help troubleshooting.

Hi @coracle,

Could you try re-installing your WPML, the missing flag icons are due to 404. It could be missing or blocked.

Then the issue with preview couldn’t load is because of the character added to the URL. Example,

https://presencehk.org/home-test-英語/

Try visiting that URL and it will not really load. And please check this http://mail-archives.apache.org/mod_mbox/tomcat-users/201708.mbox/<59806FB1.6070900@ice-sa.com>

That is also discussed here https://wpml.org/forums/topic/error-400-and-403/, and it seems host related issues since it can’t handle such requests with Chinese characters. I recommend trying it with another host.

Thanks!

Thanks @Rad.

Your comment re: URL characters was helpful. I figured out that somehow when the new pages were being created, the Chinese characters of the page name were being appended to the slug. I went in and edited the slugs and now the previews all load properly.

Do you know how I can stop the automatic addition of those characters? (Basically, it’s duplicating the default language page name and appending it to the new page url)

Grateful for your help!

Hi @coracle,

Since this is a general wordpress issue now and not theme related, you may check this article as guide.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.