From 98df3f984c1cd268b920e096b8da42a6241e20e4 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 7 Dec 2015 16:51:33 +1300 Subject: [PATCH] CRM-17628 add qfKey to contribution search links Change-Id: Ib7f57cf764a8cf4b506f4453b90f9ce841d1419e --- CRM/Contribute/Selector/Search.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index 06d96d025c..bf931d8f42 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -338,6 +338,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C $qfKey = $this->_key; $componentId = $componentContext = NULL; if ($this->_context != 'contribute') { + // @todo explain the significance of context & why we do not get these i that context. $qfKey = CRM_Utils_Request::retrieve('key', 'String', CRM_Core_DAO::$_nullObject); $componentId = CRM_Utils_Request::retrieve('id', 'Positive', CRM_Core_DAO::$_nullObject); $componentAction = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject); @@ -346,9 +347,17 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C if (!$componentContext && $this->_compContext ) { + // @todo explain when this condition might occur. $componentContext = $this->_compContext; $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', CRM_Core_DAO::$_nullObject, NULL, FALSE, 'REQUEST'); } + // CRM-17628 for some reason qfKey is not always set when searching from contribution search. + // as a result if the edit link is opened using right-click + open in new tab + // then the browser is not returned to the search results on save. + // This is an effort to getting the qfKey without, sadly, understanding the intent of those who came before me. + if (empty($qfKey)) { + $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', CRM_Core_DAO::$_nullObject, NULL, FALSE, 'REQUEST'); + } } // get all contribution status -- 2.25.1