Attempt to modify property "params" on null

Started by iberan, 22 November 2025, 16:20:42

Previous topic - Next topic

iberan

Hi Federica,

Attempt to modify property "params" on null – this error message comes, when filtering a category list with 0 result, if this category has any description.

I thing the bug is in /components/com_abook/views/category/viewhtml.php #98

if ($category->description != ''){
//inizio plugin
                $category->text=$category->description;
                PluginHelper::importPlugin('content');
Factory::getApplication()->triggerEvent('onContentPrepare', array('com_abook.category', &$category, &$category->params, 0));
                $category->description=$category->text;
//fine plugin
}

Commented out this part of script fixes this problem.

Yours,

István

Slacker

I asked ChatGPT about this and got suggestion to add just before:
if (empty($category->params)) {
    $category->params = new Joomla\Registry\Registry;
}