From 71654994a0fe6214aa3475a8ccc11506664becbd Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Thu, 10 Nov 2022 14:10:38 -0500 Subject: [PATCH] Fix WP Clean Pages check when components are disabled --- CRM/Utils/System/WordPress.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 0f6c942572..91e59b398f 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -1531,7 +1531,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { } if ($clean == 1) { //cleanURLs are enabled in CiviCRM, let's make sure the wordpress permalink settings and cache are actually correct by checking the first active contribution page - $contributionPages = \Civi\Api4\ContributionPage::get(FALSE) + $contributionPages = !CRM_Core_Component::isEnabled('CiviContribute') ? [] : \Civi\Api4\ContributionPage::get(FALSE) ->addSelect('id') ->addWhere('is_active', '=', TRUE) ->setLimit(1) @@ -1544,7 +1544,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { } else { //no active contribution pages, we can check an event page. This probably won't ever happen. - $eventPages = \Civi\Api4\Event::get(FALSE) + $eventPages = !CRM_Core_Component::isEnabled('CiviEvent') ? [] : \Civi\Api4\Event::get(FALSE) ->addSelect('id') ->addWhere('is_active', '=', TRUE) ->setLimit(1) -- 2.25.1