From 78e2927c427b1692b9dfb22e791a58b090be536f Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 1 Dec 2021 09:23:07 +1300 Subject: [PATCH] Remove isset from relationship tab civicrm/contact/view?reset=1&cid=2&relatedChild=relationship --- CRM/Contact/Page/View/Relationship.php | 1 + CRM/Contact/Page/View/UserDashBoard.php | 1 + templates/CRM/Contact/Page/View/RelationshipSelector.tpl | 6 +----- tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index 26cb59f04c..75dc0a1280 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -197,6 +197,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * @throws \CRM_Core_Exception */ public function run() { + $this->assign('entityInClassFormat', 'relationship'); $this->preProcessQuickEntityPage(); $this->setContext(); diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php index 8cba50bcb0..ca3d246e72 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -132,6 +132,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { $contactRelationships = $selector = NULL; CRM_Utils_Hook::searchColumns('relationship.columns', $columnHeaders, $contactRelationships, $selector); $this->assign('columnHeaders', $columnHeaders); + $this->assign('entityInClassFormat', 'relationship'); $dashboardElements[] = [ 'class' => 'crm-dashboard-permissionedOrgs', 'templatePath' => 'CRM/Contact/Page/View/RelationshipSelector.tpl', diff --git a/templates/CRM/Contact/Page/View/RelationshipSelector.tpl b/templates/CRM/Contact/Page/View/RelationshipSelector.tpl index 663b4aa7e0..390ad5b45b 100644 --- a/templates/CRM/Contact/Page/View/RelationshipSelector.tpl +++ b/templates/CRM/Contact/Page/View/RelationshipSelector.tpl @@ -8,11 +8,7 @@ +--------------------------------------------------------------------+ *} {* entity selector *} -{crmRegion name="crm-contact-relationshipselector-pre"} -{/crmRegion} -{if !isset($entityInClassFormat)} - {assign var="entityInClassFormat" value="relationship"} -{/if} +{crmRegion name="crm-contact-relationshipselector-pre"}{/crmRegion}
contributions[] = $this->contributionCreate([ 'contact_id' => $this->contactID, 'receive_date' => '2018-11-21', @@ -193,7 +193,7 @@ class CRM_Contact_Page_View_UserDashBoardTest extends CiviUnitTestCase { /** * Run the user dashboard. */ - protected function runUserDashboard() { + protected function runUserDashboard(): void { $_REQUEST = ['reset' => 1, 'id' => $this->contactID]; $dashboard = new CRM_Contact_Page_View_UserDashBoard(); $dashboard->_contactId = $this->contactID; -- 2.25.1