summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--context_ui/context_ui_admin.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/context_ui/context_ui_admin.inc b/context_ui/context_ui_admin.inc
index 1edd94c..d8303b5 100644
--- a/context_ui/context_ui_admin.inc
+++ b/context_ui/context_ui_admin.inc
@@ -643,7 +643,15 @@ function context_ui_rebuild() {
// db version and use the rest from code.
if ($context) {
$c->cid = $context->cid;
- $c->status = $context->status;
+ // If status has been stored as overridden but user context no longer
+ // exists, we need to re-enable this system context.
+ if ($context->status == CONTEXT_OVERRIDDEN && !isset($ui[$c-namespace][$c->attribute][$c->value])) {
+ $c->status = CONTEXT_ENABLED;
+ }
+ // Otherwise, just use the stored status.
+ else {
+ $c->status = $context->status;
+ }
context_ui_save($c);
unset($system[$c->cid]); // remove this context from unused list
}