Resolved
Reported for: WPML Multilingual CMS 4.8.1
Resolved in: WPML 4.9
Overview of the issue
In some rare cases, if you have a large amount of revisions being kept for a post, and if you do another change and preview the change, you might see wrong or not updated contents instead of the latest possible contents that you just put there.
Workaround
Our developers are working on fixing the issue.
The following workarounds should be used only after taking a proper site backup and making sure that you know what you are doing.
You can limit the number of revisions that are being kept to a lower number – e.g. 5
to do that use this code and place it in your wp-config.php
define('WP_POST_REVISIONS', 3 );
and update the problematic page
Another code workaround would be to go to
There in the function WPML_Name_Query_Filter::get_single_slug_adjusted_IDs
right before this code:
if ( ! $found ) {
$pages_with_name = $this->get_single_slug_adjusted_IDs_from_DB( $page_name_for_query, $post_parent );
$cache->set( $cache_key, $pages_with_name );
}
please add this code:
if ($this->post_type == 'revision') {
return null;
}
The solution doesnt work for me (updating wp-config.php and update the page), I don’t really want to add workaround code to our code base, will this be fixed in the newer version?
Hi there,
Yes, this issue will be resolved in WPML 4.9, which is expected to be released next week. In the meantime, you’re welcome to test it on a staging copy using the Beta 3 version available here.