From 18e200146513fdaf077566756d37e60f819dbcf3 Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 4 Oct 2023 10:52:21 -0400 Subject: [PATCH] Activity Form - Show activity_type_id if not passed in url --- CRM/Activity/Form/Activity.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index c88631dceb..c6d0379af3 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -250,13 +250,15 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { } $this->assign('contactId', $this->_currentlyViewedContactId); - // Give the context. + // FIXME: Overcomplicated 'context' causes push-pull between various use-cases for the form + // FIXME: the solution is typically to ditch 'context' and just respond to the data + // (e.g. is an activity_type_id present? is case_id present?) if (!isset($this->_context)) { $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this); if (CRM_Contact_Form_Search::isSearchContext($this->_context)) { $this->_context = 'search'; } - elseif (!in_array($this->_context, ['dashlet', 'case', 'dashletFullscreen']) + elseif (!in_array($this->_context, ['standalone', 'dashlet', 'case', 'dashletFullscreen']) && $this->_currentlyViewedContactId ) { $this->_context = 'activity'; -- 2.25.1