Commit 438d33b7 authored by Frank Febbraro's avatar Frank Febbraro
Browse files

Issue #1286396 by das-peter, jweowu: Notice: Undefined property: stdClass:: in...

Issue #1286396 by das-peter, jweowu: Notice: Undefined property: stdClass:: in variable_features_export()
parent ae28a370
......@@ -20,7 +20,7 @@ function strongarm_admin_form($form_state) {
$storage = t('Hardcoded');
$hardcoded = TRUE;
}
elseif (isset($variable->in_code_only)) {
elseif (!empty($variable->in_code_only)) {
$storage = t('In code');
$restorable = TRUE;
}
......
......@@ -33,7 +33,7 @@ function _drush_strongarm_revert($force) {
$vars = strongarm_vars_load(TRUE, TRUE);
foreach ($vars as $name => $var) {
if ($force || isset($var->in_code_only)) {
if ($force || !empty($var->in_code_only)) {
if (!isset($conf[$name]) || $var->value != $conf[$name]) {
variable_set($name, $var->value);
}
......
......@@ -115,7 +115,7 @@ if (!function_exists('variable_features_revert')) {
$vars = strongarm_vars_load(TRUE, TRUE);
foreach ($defaults as $name => $default) {
if (isset($vars[$name]->in_code_only) || ($default->value !== $vars[$name]->value)) {
if (!empty($vars[$name]->in_code_only) || ($default->value !== $vars[$name]->value)) {
variable_set($name, $default->value);
}
}
......@@ -134,7 +134,7 @@ function variable_features_rebuild($module) {
$vars = strongarm_vars_load(TRUE, TRUE);
foreach ($defaults as $name => $default) {
if (isset($vars[$name]->in_code_only) || (drupal_installation_attempted() && $vars[$name]->export_type & EXPORT_IN_CODE)) {
if (!empty($vars[$name]->in_code_only) || (drupal_installation_attempted() && $vars[$name]->export_type & EXPORT_IN_CODE)) {
variable_set($name, $default->value);
}
}
......@@ -155,7 +155,7 @@ function variable_features_export($data, &$export, $module_name) {
// Then remove any vars from the export that are only in code
$vars = strongarm_vars_load(TRUE, TRUE);
foreach ($data as $object_name) {
if(!isset($vars[$object_name]) || $vars[$object_name]->in_code_only) {
if (!isset($vars[$object_name]) || !empty($vars[$object_name]->in_code_only)) {
unset($export['features']['variable'][$object_name]);
}
}
......
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