Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 4.6.3

Topic Tags: Bug

Overview of the issue

After creating a category and translating it to another language on a site hosted on WP Engine, if you edit the category in the original language, the translation doesn’t appear immediately. You have to manually clear the object cache for the translation to appear.

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/plugins/sitepress-multilingual-cms/classes/utilities/class-wpml-wp-cache.php file.
  • Look for line 108.
  • Change:
    		private function get_keys() {
    			$found = false;
    			$keys  = wp_cache_get( self::KEYS, $this->group, false, $found );
    			if ( $found && is_array( $keys ) ) {
    				return $keys;
    			}
    
    			return [];
    		}
    
  • With:
    		private function get_keys() {
    			$found = false;
    			$keys  = wp_cache_get( self::KEYS, $this->group, false, $found );
    			if ( $found && is_array( $keys ) ) {
    				return $keys;
    			} else if (!$found && !empty($keys) && is_array($keys)) {
    				return $keys;
    			}
    
    			return [];
    		}