Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 thread is resolved. Here is a description of the problem and solution.

Problem: We are unable to preview drafts in secondary languages.

Solution: Disabling "Auto sign-in and sign-out users from all domains" from WPML -> Languages resolved the issue.

This topic contains 2 replies, has 2 voices.

Last updated by andersH-10 1 year, 9 months ago.

Assigned support staff: Lauren.

Author Posts
March 13, 2018 at 3:10 pm #1544912

andersH-10

We are using "A different domain per language". Default language is Swedish and secondary - Norwegian. Let's use real URLs in my local environment:
Swedish - hidden link
Norwegian - hidden link

When I go to Swedish post editing on Norwegian domain (e.g. hidden link) and then click Preview button I get to the page hidden link with error message: "Sorry, you are not allowed to preview drafts." (500 error)

During debugging I figured out the reason of the issue with drafts preview:
when you go to the NO domain, then edit some draft SE post, and then click Preview button - the system generates security token (preview_nonce) based on session cookie and other stuff. But then WPML redirects you to SE domain because you are previewing SE post and WP validates the token - but for validation WP uses session cookie set for SE domain and that's why validation isn't passing (session cookies are different) and we get the error.

When I click Preview button again (without changing anything) then a new tab is opened with URL like this hidden link and Preview works fine. It also works when clicking Preview link from posts overview page (hidden link), in this case the URL looks exactly like when clicking Preview button in post editing second time.

So it works when there is no preview_nonce in the URL hence no validation and session cookie doesn't matter. Attached screenshots.

I have found several similar issues on WPML forum like this one https://wpml.org/forums/topic/draft-wont-work-when-working-with-multiple-domains/
the last post says - "This problem is fixed in WPML versions 3.2 and above."

Would it be possible to fix the issue? Any advice appreciated.

Regards,
Anders

March 14, 2018 at 11:13 pm #1546406

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

I'd like to have you try a few things so we can try to isolate the issue. This is just to help me identify if it might be a conflict with another plugin or theme that is causing the problem.

** IMPORTANT ** Please backup a working copy of site files and database before continuing.

Update WordPress core.

Disable all plugins except WPML related and then temporarily change the theme to a default WordPress such as TwentySeventeen. With these settings, is the issue resolved?

March 16, 2018 at 1:54 pm #1548101

andersH-10

Hi Lauren,

the bug has gone after we disabled the WPML option "Auto sign-in and sign-out users from all domains".
We disabled the option due to other bugs that we had on the site and found the suggestion on the forum to disable the option. It was certainly a coincidence that the bug reported in this ticket disappeared as well.

Regards,
Anders