Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling for civimember disabled #22864

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 1, 2022

Overview

Add handling for civimember disabled

Before

Civi\API\Exception\NotImplementedException: "MembershipType API is not available because CiviMember component is disabled"

#0 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractAction.php(437): Civi\API\Request::create("MembershipType", "getFields", (Array:4))
#1 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractGetAction.php(44): Civi\Api4\Generic\AbstractAction->entityFields()
#2 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Generic/DAOGetAction.php(99): Civi\Api4\Generic\AbstractGetAction->setDefaultWhereClause()
#3 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Provider/ActionObjectProvider.php(69): Civi\Api4\Generic\DAOGetAction->_run(Object(Civi\Api4\Generic\Result))
#4 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(149): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOGetAction))
#5 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractAction.php(234): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
#6 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/ext/financialacls/financialacls.php(232): Civi\Api4\Generic\AbstractAction->execute()
#7 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/ext/financialacls/financialacls.php(148): _financialacls_civicrm_get_membership_type_clause()
#8 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Utils/Hook.php(275): financialacls_civicrm_selectWhereClause("Membership", (Array:1))
#9 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Utils/Hook/DrupalBase.php(73): CRM_Utils_Hook->runHooks((Array:174), "civicrm_selectWhereClause", 2, "Membership", (Array:1), NULL, NULL, NULL, NULL)
#10 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php(241): CRM_Utils_Hook_DrupalBase->invokeViaUF(2, "Membership", (Array:1), NULL, NULL, NULL, NULL, "civicrm_selectWhereClause")
#11 /home/jon/local/agbud8/vendor/symfony/event-dispatcher/EventDispatcher.php(267): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_selectWhereClause", Object(Civi\Core\CiviEventDispatcher))
#12 /home/jon/local/agbud8/vendor/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:1), "hook_civicrm_selectWhereClause", Object(Civi\Core\Event\GenericHookEvent))
#13 /home/jon/local/agbud8/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners((Array:1), "hook_civicrm_selectWhereClause", Object(Civi\Core\Event\GenericHookEvent))
#14 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php(198): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\GenericHookEvent), Object(Civi\Core\Event\GenericHookEvent))
#15 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Utils/Hook.php(167): Civi\Core\CiviEventDispatcher->dispatch("hook_civicrm_selectWhereClause", Object(Civi\Core\Event\GenericHookEvent))
#16 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Utils/Hook.php(610): CRM_Utils_Hook->invoke((Array:2), "Membership", (Array:1), NULL, NULL, NULL, NULL, "civicrm_selectWhereClause")
#17 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(3111): CRM_Utils_Hook::selectWhereClause(Object(CRM_Member_BAO_Membership), (Array:1))
#18 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Utils/SQL.php(64): CRM_Core_DAO->addSelectWhereClause()
#19 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(3097): CRM_Utils_SQL::mergeSubquery("Membership")
#20 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(3129): CRM_Core_DAO->addSelectWhereClause()
#21 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Query/Api4SelectQuery.php(636): CRM_Core_DAO::getSelectWhereClause("a")
#22 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Query/Api4SelectQuery.php(122): Civi\Api4\Query\Api4SelectQuery->getAclClause("a", "CRM_Price_BAO_LineItem")
#23 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Generic/DAOGetAction.php(112): Civi\Api4\Query\Api4SelectQuery->__construct(Object(Civi\Api4\Generic\DAOGetAction))
#24 /home/jon/local/agbud8/vendor/civicrm/civicrm-core/Civi/Api4/Generic/DAOGetAction.php

After

early return

Technical Details

Found by @MegaphoneJon - I think it only affects master....

UPDATE - yep only master 56f5e9d

Comments

@civibot
Copy link

civibot bot commented Mar 1, 2022

(Standard links)

@civibot civibot bot added the master label Mar 1, 2022
@MegaphoneJon
Copy link
Contributor

I tested this PR and while there's a second related bug that appears after this is fixed, this bug is fixed by this PR.

@seamuslee001
Copy link
Contributor

Test fails unrelated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants