From: eileen Date: Sat, 30 Jan 2021 22:24:53 +0000 (+1300) Subject: dev/core#2333 Fix issue when clicking on alpha links from 'amtg' search X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6134693a307b85bf88aab1a00fccce0e982ea8b3;p=civicrm-core.git dev/core#2333 Fix issue when clicking on alpha links from 'amtg' search --- diff --git a/CRM/Utils/PagerAToZ.php b/CRM/Utils/PagerAToZ.php index eeed2e961a..354ff43702 100644 --- a/CRM/Utils/PagerAToZ.php +++ b/CRM/Utils/PagerAToZ.php @@ -114,6 +114,7 @@ class CRM_Utils_PagerAToZ { * * @return array * with links + * @throws \CRM_Core_Exception */ public static function createLinks(&$query, $sortByCharacter, $isDAO) { $AToZBar = self::getStaticCharacters(); @@ -151,7 +152,17 @@ class CRM_Utils_PagerAToZ { $element['class'] = "active"; $klass = 'class="active"'; } - $url = CRM_Utils_System::url($path, "force=1&qfKey=$qfKey&sortByCharacter="); + $urlParams = [ + 'force' => 1, + 'qfKey' => $qfKey, + ]; + if ($query->_context === 'amtg') { + // See https://lab.civicrm.org/dev/core/-/issues/2333 + // Seems to be needed in add to group flow. + $urlParams['_qf_Basic_display'] = 1; + } + $urlParams['sortByCharacter'] = ''; + $url = CRM_Utils_System::url($path, $urlParams); // we do it this way since we want the url to be encoded but not the link character // since that seems to mess up drupal utf-8 encoding etc $url .= urlencode($link);