Created
January 3, 2017 13:24
-
-
Save vensires/42ab9b497b096dfb365b3d410cca52ea to your computer and use it in GitHub Desktop.
A small script to help you fix the notice with a Drupal variable not being able to be properly unserialized. Make sure you have the devel module enabled for the dpm function used in the error handler.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) { | |
dpm($errcontext); | |
}); | |
$variables = db_query('SELECT name, value FROM {variable}')->fetchAllKeyed(); | |
foreach($variables as $name => $values) { | |
$value = unserialize($values); | |
} | |
restore_error_handler(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment