Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
I am trying to:
Add a translation to a post/page.

1. Write the post title and content for a new post.
2. Click Save Draft or Publish.
3. Add a translation to that post.
4. Click the plus icon on language.
5. WordPress opens the translation page
6. Write the title and content.
7. Press Save Draft or Publish.

I expected to see:
Draft saved or post published.

Instead, I got:
Updating failed. You are probably offline.

- - -

I added a screenshot with the console log. It seems that WPML can't connect with the REST API and it fails. GET shows the REST url, but it's missing a slash.

Solution:
This sounds like a known issue, which will be fixed in the upcoming version. Please check if the mentioned workaround from here solves it for you temporarily: https://wpml.org/errata/rest-api-endpoint-issue-when-permalink-structure-is-missing-a-final-slash/

Relevant Documentation:
https://wpml.org/errata/rest-api-endpoint-issue-when-permalink-structure-is-missing-a-final-slash/

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 5 replies, has 2 voices.

Last updated by svenR-11 4 years, 4 months ago.

Assisted by: Marcel.

Author Posts
February 10, 2021 at 1:51 pm #8052321

svenR-11

I am trying to:
Add a translation to a post/page.

1. Write the post title and content for a new post.
2. Click Save Draft or Publish.
3. Add a translation to that post.
4. Click the plus icon on language.
5. WordPress opens the translation page
6. Write the title and content.
7. Press Save Draft or Publish.

I expected to see:
Draft saved or post published.

Instead, I got:
Updating failed. You are probably offline.

- - -

I added a screenshot with the console log. It seems that WPML can't connect with the REST API and it fails. GET shows the REST url, but it's missing a slash.

Screenshot 2021-02-10 at 15.41.49.png
February 10, 2021 at 2:22 pm #8052583

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Thank you for contacting WPML Support.

This sounds like a known issue, which will be fixed in the upcoming version. Please check if the mentioned workaround from here solves it for you temporarily: https://wpml.org/errata/rest-api-endpoint-issue-when-permalink-structure-is-missing-a-final-slash/

Please let me know.

Best Regards
Marcel

February 10, 2021 at 3:19 pm #8053711

svenR-11

Hello!

Both temporary solutions didn't work because:

I allready have the latest WPML installed and the class-wpml-url-converter-subdir-strategy.php file allready has the patch.

I also tried to force the trailing slash through wp-config.php by adding:
define( 'WP_HOME', 'hidden link' );
define( 'WP_SITEURL', 'hidden link' );

but WordPress seems to remove them by default.

- - -

The WPML plug-ins and versions I have installed:
WPML Multilingual CMS Version 4.4.9
WPML String Translation Version 3.1.7
WPML Translation Management Version 2.10.5
WPML Media Version 2.6.3

February 10, 2021 at 5:35 pm #8055093

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

may you have a staging site where I could take a look?

I would eventually also 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 and check if some configurations might need to be changed

Your next answer will be private which means only you and I have access to it.

❌ Please backup your database and website ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please add the Links to the […] Edit Screen, the Page/Post where you insert the […] and the corresponding Front End Page/Screen

Best Regards
Marcel

February 12, 2021 at 12:10 pm #8070573

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

thanks, I was able to reproduce it on your test site.

I configured a new Sandbox environment and tried it with a default Post and I can't reproduce the issue here using the same Permalink settings: hidden link

Please try if you can reproduce it on our isolated Sandbox environment. Try first to add your CPT to our default Theme in functions.php and try to reproduce this way. If the error doesn't occur there, try to install your full Theme to exclude any error in your theme code.

Please let me know.

Best Regards
Marcel