- Status
- Resolved
- Reported for
- WPML Multilingual CMS 4.6.4
- Resolved in
- WPML 4.6.5
Overview of the issue
If you use WPML’s Classic Translation Editor and you edit a previously translated page, you may encounter that the previous translation is replaced with the original content.
Workaround
Please find and open: \wp-content\plugins\sitepress-multilingual-cms\addons\wpml-page-builders\classes\Shared\st\class-wpml-pb-string-translation.php
Find:
public function get_package_strings( array $package_data ) {
$strings = array();
$package_id = $this->get_package_id( $package_data );
if ( $package_id ) {
$getPackageStrings = Cache::memorize(
self::CACHE_GROUP_KEY,
HOUR_IN_SECONDS,
function( $packageId ) {
return $this->getPackageStringsFromDb( $packageId );
}
);
$strings = $getPackageStrings( $package_id );
}
return $strings;
}
And change it with
public function get_package_strings( array $package_data ) {
$strings = array();
$package_id = $this->get_package_id( $package_data );
if ( $package_id ) {
$getPackageStrings =
function( $packageId ) {
return $this->getPackageStringsFromDb( $packageId );
};
$strings = $getPackageStrings( $package_id );
}
return $strings;
}