Page 1 of 1

[Solved] Category Blog error when set tag

Posted: Sun Oct 08, 2017 1:26 am
by xuanhau
In Joomla 3.8.1, if you create menu with category blog/list combine with tag item, you will have empty page with any category.

Solve:
Open the file components\com_content\models\category.php, Line: 244 ==> disable this line

Code: Select all

			
			$model->setState('list.direction', $this->getState('list.direction'));
			$model->setState('list.filter', $this->getState('list.filter'));
			//$model->setState('filter.tag', $this->getState('filter.tag'));
I solved this issue

Re: [Solved] Category Blog error when set tag

Posted: Sun Oct 08, 2017 1:48 am
by jackrabbit
That's not a valid 'solution' because that file will be overwritten when the core is updated. You'll need to write a plugin or a method using JModelLegacy in your template to achieve the goal and avoid overwrite.

Something like this (not a working method, just a clue where to search for a solution)

Code: Select all

JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel');
$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
$app = JFactory::getApplication();
$myParams = $app->getParams();
$model->setState('params', $myParams);

Re: [Solved] Category Blog error when set tag

Posted: Sun Oct 08, 2017 3:41 am
by xuanhau
I think this is the bug. Because of the code $this->getState('filter.tag') will get filter tag from menu to other menu.
If you create menu with default category and category menu with any tag. You will receive empty page after select tag category menu.

You can test in your side.