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.

1
  • This is not an error in Joomla's core, so please make sure you have updated all your extensions as it will be one of those that's causing the error. Either that or revert any core hacks you may have done Commented Apr 21, 2016 at 12:57

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

Comments

2

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);

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.