Created
November 27, 2013 19:34
-
-
Save gabrielmansour/7681781 to your computer and use it in GitHub Desktop.
Identify any unserialization issues in Drupal to we can resolve them
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
#!/usr/bin/env drush | |
# Once it prints the faulty variable names, just re-set the values using `drush vset {variable_name} "{value}" | |
$variables = db_query('SELECT name, value FROM {variable}')->fetchAllKeyed(); | |
foreach ($variables as $key => $val) { | |
$v = unserialize($val); | |
if ($v === FALSE && $val !== 'b:0;') { | |
print "Error unserializing '$key' (val = $val )\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment