From 9f8c076e4055cc1299081d05ffdf8aa67017c22d Mon Sep 17 00:00:00 2001 From: "Robert J. Lang" Date: Mon, 11 Nov 2024 14:09:43 -0800 Subject: [PATCH] Issue #484: Fix crash during upgrade from D7. --- ubercart.info | 2 +- uc_order/uc_order.rules_defaults.inc | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ubercart.info b/ubercart.info index ff740baf..c9c3dfe4 100644 --- a/ubercart.info +++ b/ubercart.info @@ -4,7 +4,7 @@ package = Ubercart - core backdrop = 1.x type = module -dependencies[] = system (>= 1.21.0) +dependencies[] = system (>= 1.28.2) dependencies[] = rules (>= 2.2.0) dependencies[] = views dependencies[] = image diff --git a/uc_order/uc_order.rules_defaults.inc b/uc_order/uc_order.rules_defaults.inc index 4fa5c18b..125bc669 100644 --- a/uc_order/uc_order.rules_defaults.inc +++ b/uc_order/uc_order.rules_defaults.inc @@ -8,6 +8,12 @@ * Implements hook_default_rules_configuration(). */ function uc_order_default_rules_configuration() { + // If we are in the middle of upgrading from D7, filter_default_format() is + // not yet set, so don't return any default rules. See + // https://github.com/backdrop-contrib/ubercart/issues/484. + if (state_get('update_d7_upgrade')) { + return array(); + } $rule = rules_reaction_rule(); $rule->label = t('E-mail an order update notification'); $rule->active = TRUE;