Merge pull request #19200 from eileenmcnaughton/act_contact
[civicrm-core.git] / CRM / Utils / Pager.php
index a5bc97b8504433ea8ac736666cecf128c63cfeaf..c07aa8798afeea1ec5b0c2be34ce08f41ef88479 100644 (file)
@@ -186,7 +186,7 @@ class CRM_Utils_Pager extends Pager_Sliding {
         $currentPage = max((int ) @$_POST[self::PAGE_ID], 1);
       }
       elseif (isset($_POST[self::PAGE_ID_BOTTOM])) {
-        $currentPage = max((int ) @$_POST[self::PAGE_ID_BOTTOM]);
+        $currentPage = max((int ) @$_POST[self::PAGE_ID_BOTTOM], 1);
       }
     }
     elseif (isset($_GET[self::PAGE_ID])) {
@@ -239,8 +239,7 @@ class CRM_Utils_Pager extends Pager_Sliding {
    * @return string
    */
   public function getCurrentLocation() {
-    $config = CRM_Core_Config::singleton();
-    $path = $_GET[$config->userFrameworkURLVar] ?? NULL;
+    $path = CRM_Utils_System::currentPath();
     return CRM_Utils_System::url($path, CRM_Utils_System::getLinksUrl(self::PAGE_ID, FALSE, TRUE), FALSE, NULL, FALSE) . $this->getCurrentPageID();
   }