From 81eb94b557c9eaffbb8f07b4440e009ee351c23b Mon Sep 17 00:00:00 2001 From: Alice Frumin Date: Wed, 7 Nov 2018 17:36:52 -0500 Subject: [PATCH] send links on any page that extends CRM_Core_Page_basic thru hook_civicrm_links --- CRM/Core/Page/Basic.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Page/Basic.php b/CRM/Core/Page/Basic.php index 48af5ebf53..de39350eb7 100644 --- a/CRM/Core/Page/Basic.php +++ b/CRM/Core/Page/Basic.php @@ -319,11 +319,12 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { } } + $object_type = get_class($object); + if (!$forceAction) { if (array_key_exists('is_reserved', $object) && $object->is_reserved) { $values['class'] = 'reserved'; // check if object is relationship type - $object_type = get_class($object); $exceptions = array( 'CRM_Contact_BAO_RelationshipType', @@ -365,7 +366,16 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { // make sure we only allow those actions that the user is permissioned for $newAction = $newAction & CRM_Core_Action::mask($permissions); - $values['action'] = CRM_Core_Action::formLink($links, $newAction, array('id' => $object->id)); + $values['action'] = CRM_Core_Action::formLink( + $links, + $newAction, + ['id' => $object->id], + 'more', + FALSE, + "basic.$object_type.page", + $object_type, + $object->id + ); } /** -- 2.25.1