Thread Starter
yivi
(@yivi)
I have my a separate fork for wp-migrate-db, so I’d have no problem modifying it; and it seems that the problematic code would be around here, but I’m a bit out of my depth:
function recursive_unserialize_replace( $data, $serialized = false, $parent_serialized = false ) {
// some unseriliased data cannot be re-serialized eg. SimpleXMLElements
try {
if ( is_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) {
$data = $this->recursive_unserialize_replace( $unserialized, true, true );
}
elseif ( is_array( $data ) ) {
$_tmp = array( );
foreach ( $data as $key => $value ) {
$_tmp[ $key ] = $this->recursive_unserialize_replace( $value, false, $parent_serialized );
}
$data = $_tmp;
unset( $_tmp );
}
// Submitted by Tina Matter
elseif ( is_object( $data ) ) {
$dataClass = get_class( $data );
$_tmp = new $dataClass( );
foreach ( $data as $key => $value ) {
$_tmp->$key = $this->recursive_unserialize_replace( $value, false, $parent_serialized );
}
Thanks and regards,
Thread Starter
yivi
(@yivi)
Maybe using $_tmp clone($data), instead of $new ($dataClass)?
But the language object should provide a “clone” method, right?
Plugin Author
Chouby
(@chouby)
I don’t know wp-migrate-db but I imagine that such migration may going wrong due to some caching done by Polylang. search for the ‘_transient_pll_languages_list’ entry in wp_options and delete it. It should be automatically re-created with hopefully right values at first page load.
Chouby, I did what you say “search for the ‘_transient_pll_languages_list’ entry in wp_options and delete it. It should be automatically re-created with hopefully right values at first page load”
Now, when I switch to English language (default is Spanish) I get a 404 page. In Setting page it says that there are pages, posts, categories and tag without language. But When I look for pages all them has the default language version and its english version also.
Sorry, my english is not very good.
Thanks