From 512a4fac7ab498ccc76b2d9cc1574cf902ec5c61 Mon Sep 17 00:00:00 2001 From: Joel Thiessen <444632+joelclimbsthings@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:39:22 -0800 Subject: [PATCH] Fix marketing task not displaying on Atomic sites. (https://github.com/woocommerce/woocommerce-admin/pull/8150) * Should accept a boolean value for is_visible property with an extension, and only evaluate a set of rules * Adding changelog * Moving fix to RuleEvaluator so it applies to other rulesets --- plugins/woocommerce-admin/changelogs/fix-8149 | 4 ++++ .../src/RemoteInboxNotifications/RuleEvaluator.php | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 plugins/woocommerce-admin/changelogs/fix-8149 diff --git a/plugins/woocommerce-admin/changelogs/fix-8149 b/plugins/woocommerce-admin/changelogs/fix-8149 new file mode 100644 index 00000000000..df17eccc104 --- /dev/null +++ b/plugins/woocommerce-admin/changelogs/fix-8149 @@ -0,0 +1,4 @@ +Significance: patch +Type: Fix + +Fixing marketing task not displaying on Atomic sites #8150 diff --git a/plugins/woocommerce-admin/src/RemoteInboxNotifications/RuleEvaluator.php b/plugins/woocommerce-admin/src/RemoteInboxNotifications/RuleEvaluator.php index 60e3779caba..076eb448747 100644 --- a/plugins/woocommerce-admin/src/RemoteInboxNotifications/RuleEvaluator.php +++ b/plugins/woocommerce-admin/src/RemoteInboxNotifications/RuleEvaluator.php @@ -37,6 +37,11 @@ class RuleEvaluator { * @return bool The result of the operation. */ public function evaluate( $rules, $stored_state = null, $logger_args = array() ) { + + if ( is_bool( $rules ) ) { + return $rules; + } + if ( ! is_array( $rules ) ) { $rules = array( $rules ); }