avoid error in test environments using built-in php web server
authordemeritcowboy <demeritcowboy@hotmail.com>
Tue, 21 Sep 2021 04:10:50 +0000 (00:10 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Tue, 21 Sep 2021 04:10:50 +0000 (00:10 -0400)
CRM/Report/Form.php

index 352bbf35eccf2cf47ccf7b57aff3f846c51dceaa..da4e6ba09d07968ffef4655648fdf6cdd931e13a 100644 (file)
@@ -626,6 +626,10 @@ class CRM_Report_Form extends CRM_Core_Form {
 
       // set qfkey so that pager picks it up and use it in the "Next > Last >>" links.
       // FIXME: Note setting it in $_GET doesn't work, since pager generates link based on QUERY_STRING
+      if (!isset($_SERVER['QUERY_STRING'])) {
+        // in php 7.4 can do this with less lines with ??=
+        $_SERVER['QUERY_STRING'] = '';
+      }
       $_SERVER['QUERY_STRING'] .= "&qfKey={$this->controller->_key}";
     }