From: Mathieu Lu Date: Sat, 2 Sep 2023 18:02:07 +0000 (-0400) Subject: Fix fatal on Manage Extensions caused by financialacls links X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9f9f84435c5e9846d9f4e2768f4d89e2034a5826;p=civicrm-core.git Fix fatal on Manage Extensions caused by financialacls links --- diff --git a/ext/financialacls/financialacls.php b/ext/financialacls/financialacls.php index 41992b8a5a..0e079fe401 100644 --- a/ext/financialacls/financialacls.php +++ b/ext/financialacls/financialacls.php @@ -384,7 +384,13 @@ function financialacls_civicrm_alterMenu(array &$menu): void { $menu['civicrm/admin/financial/financialType']['access_arguments'] = [['administer CiviCRM Financial Types']]; } -function financialacls_civicrm_links(string $op, ?string $objectName, ?int $objectID, array &$links, ?int &$mask, array &$values) { +/** + * Hide edit/enable/disable links for memberships of a given Financial Type + * Note: The $objectID param can be an int, string or null, hence not typed + * + * Implements hook_civicrm_links() + */ +function financialacls_civicrm_links(string $op, ?string $objectName, $objectID, array &$links, ?int &$mask, array &$values) { if ($objectName === 'MembershipType') { $financialType = CRM_Core_PseudoConstant::getName('CRM_Member_BAO_MembershipType', 'financial_type_id', CRM_Member_BAO_MembershipType::getMembershipType($objectID)['financial_type_id']); $hasEditPermission = CRM_Core_Permission::check('edit contributions of type ' . $financialType);