diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index ea58c35031545..33ebb39e0d143 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -78,41 +78,49 @@ protected function populateState($ordering = null, $direction = null) { $app = JFactory::getApplication(); + $input = $app->input; + // Adjust the context to support modal layouts. - if ($layout = $app->input->get('layout')) + if ($layout = $input->get('layout')) { $this->context .= '.' . $layout; } - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); + // Deal with Hathor which is not using search tools + $rawInputData = $input->getArray(); + + if (isset($rawInputData['filter_search'])) + { + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access'); - $this->setState('filter.access', $access); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access'); + $this->setState('filter.access', $access); - $authorId = $app->getUserStateFromRequest($this->context . '.filter.author_id', 'filter_author_id'); - $this->setState('filter.author_id', $authorId); + $authorId = $app->getUserStateFromRequest($this->context . '.filter.author_id', 'filter_author_id'); + $this->setState('filter.author_id', $authorId); - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); - $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id'); - $this->setState('filter.category_id', $categoryId); + $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id'); + $this->setState('filter.category_id', $categoryId); - $level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level'); - $this->setState('filter.level', $level); + $level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level'); + $this->setState('filter.level', $level); - $language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', ''); - $this->setState('filter.language', $language); + $language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', ''); + $this->setState('filter.language', $language); - $tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', ''); - $this->setState('filter.tag', $tag); + $tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', ''); + $this->setState('filter.tag', $tag); + } // List state information. parent::populateState('a.id', 'desc'); // Force a language - $forcedLanguage = $app->input->get('forcedLanguage'); + $forcedLanguage = $input->get('forcedLanguage'); if (!empty($forcedLanguage)) { @@ -167,8 +175,8 @@ protected function getListQuery() $this->getState( 'list.select', 'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' . - ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.ordering, a.featured, a.language, a.hits' . - ', a.publish_up, a.publish_down' + ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.ordering, a.featured, a.language, a.hits' . + ', a.publish_up, a.publish_down' ) ); $query->from('#__content AS a');