Skip to content Skip to sidebar

Open

Reported for: WPML Multilingual CMS 4.8.1

Topic Tags: Bug

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

/wp-content/plugins/sitepress-multilingual-cms/inc/query-filtering/wpml-name-query-filter.class.php

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;
		}

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>