When trying to edit a component container in your own admin menu, the message: "Call to a member function load() on null" is returned. The error is in the file "administrator/components/com_menus/tmpl/item/edit_container.php". On line 65, the following is called: "$lang->load("$extension.sys", JPATH_ADMINISTRATOR)", but the variable $lang is not defined. So, for example, on line 21, just add: "$lang = $this->getLanguage();".
| Labels |
Removed:
?
|
||
| Labels |
Added:
No Code Attached Yet
|
||
Hi,
he error occurs in any language version Joomla 6.1.2, including the default English version, when you create your own administrator menu and then try to edit the Components container in that custom menu.
Steps to reproduce:
Menus → Manage
Select: Administrator
Click New
Title: My admin menu
Unique Name: my-admin-menu
Select Import a Preset: Preset - Joomla Main Menu
Click Save & Close
Content → Administrator Modules
Open Admin Menu for editing
Select Menu to Show: My admin menu
Click Save & Close
Menus → My admin menu
Open Components for editing, the following error occurs: Call to a member function load() on null
In the file: /administrator/components/com_menus/tmpl/item/edit_container.php the $lang object is used on line 65, but it is not initialized anywhere in the file.
It should therefore be sufficient to initialize the $lang object near the beginning of the file, e.g.: $lang = $this->getLanguage();
I have successfully tested this fix both by modifying the file directly and by creating an override in the Atum template. Until an official fix is available, I am using the template override.
Regards
Standa
confirmed the bug - thanks for the detailed instructions in how to replicate it
As you have a fix are you able to submit a pull request with the fix please
| Labels |
Added:
bug
|
||
As it didnt look like you were going to create a pull request I did it for you
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-08-16 16:39:13 |
| Closed_By | ⇒ | QuyTon |
This must have changed while I was not active with Joomla. Sorry I did not know. I will stop closing them. Thanks.
Thanks for reporting.
I see your code and it looks plausible. But I cannot replicate your issue.
Which Joomla Version? Which language are you using?
Could you describe waht you did exactly and maybe add a screenshot?