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 17 replies, has 3 voices.

Last updated by Sumit 6 months, 1 week ago.

Assigned support staff: Sumit.

Author Posts
March 28, 2019 at 5:11 pm

ideaspace

I am not able to Preview or Preview Changes for posts and pages in French on our site. It works fine in English, but in French it returns the error “Désolé, vous n’avez pas l’autorisation de prévisualiser les brouillons.”, which means, “Sorry, you do not have authorization to preview drafts.”

As per our testing it worked for staging site where we are using /fr for french language URL

We are getting issue when we are using different domain for french language( Which is supported by WPML )
hidden link

March 29, 2019 at 5:22 am #3487971

Dennis

Hi,

Welcome to WPML Support forum.

I noticed that the issue occurs only when you click the 'Preview' button. But clicking the permalink could let you preview your post/page. The 'preview page' after clicking 'Save draft' also works correctly.

Does the issue persists if you:

-Deactivate all the plugins that are not related to WPML
-Switch for a moment to a WordPress default theme like Twenty Sixteen.

After that, go back to your post/page and try to preview your draft content, does the issue still persists?

Note: Please backup your site first before doing this test.

Also, I noticed that your WPML plugins is quite outdated. Please consider updating WPML plugins to latest version. You can update them at Plugins > Add new > Commercial Tab

Note: Please secure a complete backup of your site before updating WPML plugins.

Kind regards,
Dennis

March 29, 2019 at 11:03 am #3490505

ideaspace

Yes issue occurs only when you click the 'Preview' button which we want to fix. As for publish post before update anything, we want to check it's preview for different languages.

Does the issue persists if you:
-Deactivate all the plugins that are not related to WPML
-Switch for a moment to a WordPress default theme like Twenty Sixteen.
=> I had took the backup and update the WPML plugins. I have tried both the above alternative method and issue still persists. I am not able to preview.

Looks like issue is related to either of 2 reason
1) Auto sign in feature for multi domain is not working( refer screenshot ). For both language we have to sign in differently.
2) Cross domain issue. For both languages different domains are setup.

Can you please help us to fix this preview post/page issue?

April 1, 2019 at 8:10 am #3505177

Dennis

Hi,

Thank you for your updates.

For some reason the provided FTP access does not work on my end. Could please check?

Please enable the WordPress debug log. This will allow us to see if any PHP errors are being produced.

More Info:
https://codex.wordpress.org/Debugging_in_WordPress
https://wpml.org/documentation/support/debugging-wpml/

Edit wp-config.php and insert the following lines:

/*enable debugging*/
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false);

- Add it above the line

 /* That's all, stop editing! Happy blogging. */ 

Repeat the action of creating the issue.
Locate the debug log in: /wp-content/debug.log using FTP, then edit/view the content of the file. Do you see any php errors related to WPML?

Thank you.

Kind regards,
Dennis

April 1, 2019 at 11:37 am #3507289

ideaspace

Hi,

Provided details are for SFTP and port number 2222. WordPress debug log is already enable on site using plugin, please check the log here hidden link.

There are some error logs in the system which you can see from the above link but they are not related to preview functionality.

April 2, 2019 at 2:26 am #3512735

Dennis

Hi,

Thank you for your reply.

I will consult this issue to our 2nd tier support about this issue and I will revert back as soon as I got some more information regarding the issue.

Thank you.

Kind regards,
Dennis

April 3, 2019 at 4:22 am #3522563

Dennis

Hi,

Thank you for waiting.

Could you please try to disable the 'Auto sign-in and sign-out users from all domains' option from WPML > Languages > Language URL format, Re-save your permalinks settings at Settings > Permalinks and see if it resolves the issue?

Please let me know.

Kind regards,
Dennis

April 3, 2019 at 3:26 pm #3527993

ideaspace

That's resolved the preview issue. But can we get auto sign in feature also working for our site?

April 4, 2019 at 7:16 am #3532779

Dennis

Hi,

I got some feedback from our 2nd tier support. It seems that your language switcher comes from the theme. Could you please try to add WPML language switcher to the footer?

You can add it on WPML > Languages > Footer language switcher. Then please try to activate the auto sign in feature.

The reason is that WPML language switcher invoke the session sharing request to another domain and once session is created to secondary domain client can preview the pages.

Please let me know how it goes.

Kind regards,
Dennis

April 4, 2019 at 1:31 pm #3535321

ideaspace

I have added WPML language switcher to the footer using WPML setting. But it's still not working.

April 5, 2019 at 2:24 am #3539493

Dennis

Hi,

Thank you for your reply.

I have forwarded your updates to our 2nd tier support team. I will revert back as soon as I got some feedback from them.

Thank you.

Kind regards,
Dennis

April 8, 2019 at 6:31 am #3554471

Dennis

Hi,

I have escalated this issue to our 2nd tier support for further debugging. One of the 2nd tier supporters will respond to you soon.

Kind regards,
Dennis

April 10, 2019 at 1:44 am #3571377

Dennis

Hi,

I got some feedback from our 2nd tier support. They noticed that JQuery was added twice - one from WP and another coming from functions.php line number 465

wp_enqueue_script( 'jquery-lib', '<em><u>hidden link</u></em>');

This is causing issue with WPML js and preventing session sharing js to work. However, removing this js will cause other js errors as this is a custom theme.

To continue debugging, we would like to request for your permission if we can test with a default theme?

Thank you.

Kind regards,
Dennis

April 10, 2019 at 10:48 am #3575149

ideaspace

Hi,

We have took the backup of full site. You can go ahead with testing. Make sure you revert back site in the normal state after testing get completed. Thanks.

April 11, 2019 at 1:04 am #3582481

Dennis

Hi,

Thank you for your reply. Our 2nd tier support will continue with the testing procedure. Will revert back to you as soon as we got some results.

Kind regards,
Dennis