Commit db8fed6b authored by young hahn's avatar young hahn
Browse files

Ensure schema cache is not stale and actually init. Allows strongarm to be...

Ensure schema cache is not stale and actually init. Allows strongarm to be used during install tasks of install profile.
parent fbaabb27
......@@ -21,20 +21,21 @@ function strongarm_set_conf($reset = FALSE) {
$var_conf = $cache->data;
}
else {
// Ensure that the schema cache is not stale when we init. This check, for
// example, prevents strongarm from initing when install profiles are run.
// Ensure that the schema cache is not stale when we init.
$schema = drupal_get_schema('variable');
if (isset($schema['export'])) {
$var_conf = array();
ctools_include('export');
foreach (ctools_export_load_object('variable') as $var) {
$var_conf[$var->name] = $var->value;
}
cache_set('strongarm', $var_conf);
if (!isset($schema['export'])) {
drupal_get_schema('variable', TRUE);
}
$var_conf = array();
ctools_include('export');
foreach (ctools_export_load_object('variable') as $var) {
$var_conf[$var->name] = $var->value;
}
cache_set('strongarm', $var_conf);
}
global $conf;
$conf = isset($var_conf) ? $var_conf : $conf;
$conf = $var_conf;
}
/**
......
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