Skip to content

Instantly share code, notes, and snippets.

@mpezzi
Created September 6, 2013 18:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mpezzi/6468134 to your computer and use it in GitHub Desktop.
Save mpezzi/6468134 to your computer and use it in GitHub Desktop.
Find corrupt values in variable table
<?php
$result = db_select('variable', 'v')
->fields('v', array('name', 'value'))
->orderBy('name', 'ASC')
->execute()
->fetchAll();
$rows = array();
foreach ($result as $row) {
$value = @unserialize($row->value);
if ($value === FALSE && $row->value != serialize(FALSE)) {
$rows[$row->name] = array('name' => $row->name, 'value' => $row->value);
}
}
dpm($rows);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment