This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

unserialize fails after moving db or saving db

11 years ago

I’ve found that the page builder plugin stops working if I manually save the ‘panels_data’ meta_value in the wp_postmeta table inside phpMyAdmin. i dont have to make any changes, i just have to resave for this issue to occurr.

I thought it might be an encoding issue, but both the database and wordpress are utf8, so im not exactly sure why this issue is happening.

I have a temporary solution by overriding the wordpress core function maybe_unserialize with this:

function siteorigin_maybe_unserialize( $original ) {
if ( is_serialized( $original ) ) { // don’t attempt to unserialize data that wasn’t serialized going in
// fix from: http://www.php.net/manual/en/function.unserialize.php#76012
$original = preg_replace(‘!s:(d+):”(.*?)”;!se’, “‘s:’.strlen(‘$2′).’:”$2″;'”, $original );
return @unserialize( $original );
}
return $original;
}

This is the only plugin where i have noticed this issue, so I’m hoping this could be fixed in future releases, so that I don’t have to make direct code modifications to the plugin which have to potential to be overwritten next time I go to update.

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Have a different question or issue?

Start New Thread