Neo
Neo

Reputation: 63

Fatal error: Cannot use object of type stdClass as array after upgrading to Joomla 3.5.1

Fatal error: Cannot use object of type stdClass as array in dministrator/components/com_menus/models/item.php on line 548

Lines #546-#550:

// Get selected fields
$filters = JFactory::getApplication()->getUserState('com_menus.items.filter');
$data['published'] = (isset($filters['published']) ? $filters['published'] : null);
$data['language'] = (isset($filters['language']) ? $filters['language'] : null);
$data['access'] = (isset($filters['access']) ? $filters['access'] : null);

Error occurred while creating a new menu item in Menu Manager.

The Menu Manager works fine until upgrading from Joomla 3.4.1 to 3.5.1.

Upvotes: 1

Views: 1073

Answers (3)

Neo
Neo

Reputation: 63

Thanks a lot for the pointers, Mark and Rishi.

I solved the problem by downloading the full Joomla 3.5.1 package and replace the entire administrator/components/com_menus directory, and it works now!

I suspect there are some files missing during the 3.4.1->3.5.1 update process (using the Joomla Update Manager). I would recommend doing manual upgrade to avoid unexpected or unwanted situations.

Upvotes: 0

Mark Baker
Mark Baker

Reputation: 212522

As $filters is an object with properties, not an array with elements; so you need to use object syntax to access those properties:

$data['published'] = (isset($filters->published) ? $filters->published : null);
$data['language'] = (isset($filters->language) ? $filters->language : null);
$data['access'] = (isset($filters->access) ? $filters->access : null);

Upvotes: 2

Niklesh Raut
Niklesh Raut

Reputation: 34924

Ensure your extensions are running the latest versions.

You can also search for uses of

JFilterInput::clean(SOMETEXT);

and replace it with:

$filter = new JFilterInput;
$filter->clean(SOMETEXT);

Check this : https://docs.joomla.org/J3.x:Fatal_Error_in_Input_Filtering/en

Upvotes: 2

Related Questions