Commit 2e9a16ad authored by patricksettle's avatar patricksettle
Browse files

#1094598 #55: hook_update_N() should return array, in this case an empty...

#1094598 #55: hook_update_N() should return array, in this case an empty array.  strongarm.drush.inc didn't make it in the last commit, including here.
parent 43224dd1
<?php
/**
* Implementation of hook_drush_command().
*/
function strongarm_drush_command() {
$items = array();
$items['strongarm-revert'] = array(
'description' => 'Revert all strongarmed variables from code to the database.',
'options' => array(
'force' => 'Reset all variables, including those that are marked as already being set to the database.',
),
'bootstrap' => 'DRUSH_BOOTSTRAP_DRUPAL_FULL',
);
return $items;
}
/**
* Command callback for strongarm_revert.
*/
function drush_strongarm_revert() {
_drush_strongarm_revert(drush_get_option('force', FALSE));
drush_log('Pushed variables from code to the database.', 'success');
}
/**
* Handle the revert of variables into the database.
*/
function _drush_strongarm_revert($force) {
global $conf;
$vars = strongarm_vars_load(TRUE, TRUE);
foreach ($vars as $name => $var) {
if ($force || isset($var->in_code_only)) {
if (!isset($conf[$name]) || $var->value != $conf[$name]) {
variable_set($name, $var->value);
}
}
}
}
......@@ -52,6 +52,7 @@ function strongarm_update_6201() {
* Update 6202: Set all strongarm variables that are only set in code in the database.
*/
function strongarm_update_6202() {
$ret = array();
$variables = strongarm_vars_load();
if (!empty($variables)) {
foreach ($variables as $var_name => $var) {
......@@ -61,4 +62,5 @@ function strongarm_update_6202() {
}
}
}
return $ret;
}
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