"The preview could not load" error when attempting to edit a page using Cornerstone

I have suddenly found that I cannot use Cornerstone to edit pages on a customer’s website. The error message that Cornerstone displays is the following:

The preview could not load. This is most often related to a plugin conflict or aggressive page cacheing. Checking the developer console for errors could indicate what went wrong.

Origin URL: https://kayn.nl

Preview URL: https://kayn.nl/en/discography/

I do not have any plugins installed that would affect page caching, so I’m not sure what’s going on. Any help would be appreciated.

Hello @Takaji,

Thanks for asking. :slight_smile:

Request you to please take a look at our builder preview warning guide for potential solution. We have listed couple of solutions for Origin and Preview URL error message on first paragraph itself:

Let us know how it goes.

Thanks.

Thanks for the info! I tried disabling plugins, and found Polylang to be the culprit. I will contact the developers to address the problem.

You’re always welcome!

Unfortunately, Polylang is not compatible with Cornerstone at the moment. Please see this thread:

Please I’m having this same issue. I’ve tried to follow the thread but still not solution. I will appreciate help. Thank you. My website is at https://sajigroup.com

Hello There,

We already have a pending issue in our issue tracker which aims to resolve the conflict between Polylang and Cornerstone. Our developers is already investigating it and hopefully a release update will be coming out soon.

Thank you for your understanding.

Hi!

I am experiencing the same issue but not on all translated pages. However, it was quite easy to trace back to the lines of code that were causing this issue as the preview URL was just wrong.

By replacing lines 54-57 in include/classes/content/class-content.php:

$wpml = CS()->loadComponent('Wpml');                                                                                                                                                                                                                                                                               
$wpml->before_get_permalink();                                                                                                                                                                                                                                                                                     
$this->permalink = apply_filters( 'wpml_permalink', get_permalink( $post ), apply_filters('cs_locate_wpml_language', null, $post ) );                                                                                                                                                                              
$wpml->after_get_permalink();

with

$this->permalink = get_permalink( $post );

everything works just fine. I would recommend to abstract the entire WPML functionality in a MultiLanguage class and then derive a WPML or Polylang Implementation from that, that can be loaded depending on which plugin is installed. I haven’t looked into the details of the WPML implementation as the above works for me. Would be great if that could be integrated into the next release.

Thank you

3 Likes

Hey There,

This is a great resource information. We will forward this to our issue tracker so that our developers can take it closely and hopefully integrate change in the next update release.

Thank you for your understanding.

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