diff --git a/app/src/Controller/DashboardsController.php b/app/src/Controller/DashboardsController.php index 0e5ffb211..4d51ffafb 100644 --- a/app/src/Controller/DashboardsController.php +++ b/app/src/Controller/DashboardsController.php @@ -311,9 +311,9 @@ public function search() { // Gather our search string. $q = ''; - if(!empty($this->request->getQuery('q'))) { + if(!empty($this->request->getData('q'))) { // A search was passed in from the form on the Global Search bar. - $q = trim($this->request->getQuery('q')); + $q = trim($this->request->getData('q')); } // Only process the request if we have a string of non-space characters @@ -398,7 +398,7 @@ public function search() { $this->Flash->information(__d('result', 'search.exact', - [filter_var($this->request->getQuery('q'), FILTER_SANITIZE_SPECIAL_CHARS), + [filter_var($this->request->getData('q'), FILTER_SANITIZE_SPECIAL_CHARS), __d('controller', $matchClass, [1])])); // Redirect to the matchClass controller diff --git a/app/templates/element/searchGlobal.php b/app/templates/element/searchGlobal.php index 3282f4e36..7eef6e56d 100644 --- a/app/templates/element/searchGlobal.php +++ b/app/templates/element/searchGlobal.php @@ -26,7 +26,7 @@ */ $options = [ - 'type' => 'get', + 'type' => 'post', 'url' => [ 'plugin' => null, 'controller' => 'dashboards', @@ -52,7 +52,7 @@ ['class' => 'visually-hidden'] ); $globalSearchInputClass = 'global-search-query'; - if(!empty($this->request->getQuery('q'))) { + if(!empty($this->request->getData('q'))) { $globalSearchInputClass .= ' has-value'; } print $this->Form->input( @@ -60,8 +60,7 @@ [ 'id' => 'q', 'class' => $globalSearchInputClass, - 'placeholder' => __d('field','search.placeholder'), - 'value' => $this->request->getQuery('q') + 'placeholder' => __d('field','search.placeholder') ] ); print $this->Form->button(