Commit bbe7d2e6 authored by vadim's avatar vadim
Browse files

#1087212: working on missed queries on update

parent e42df691
......@@ -48,16 +48,25 @@ function menu_token_uninstall() {
drupal_uninstall_schema('menu_token');
}
/**
* Implementation of hook_update_N().
*/
function menu_token_update_6000() {
return drupal_install_schema('menu_token');
}
/**
* Implementation of hook_update_N().
*/
function menu_token_update_6001() {
$ret = array();
drupal_install_schema('menu_token');
foreach (variable_get('menu_token_enabled', array()) as $mlid => $link_path) {
$item = (object)array('mlid' => $mlid, 'link_path' => $link_path);
drupal_write_record('menu_token', $item);
$status = drupal_write_record('menu_token', $item);
if (!$status) {
$ret['#abort'] = array('success' => FALSE, 'query' => 'Could not add records to databse');
return $ret;
}
unset($item);
}
return $ret;
variable_del('menu_token_enabled');
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment