Issue
After upgrading Joomla v3 to Joomla v4 (4.3.4), website admin cannot add any new menu items. The following error is displayed when trying to save a new menu item:

Save failed with the following error: Joomla\Component\Menus\Administrator\Table\MenuTable::_getNode(1, id) failed.
Existing menus are working fine, they can also be edited, it’s only new menu items that are affected.
Resolution
The issue was caused by a missing root menu entry (with id:1) in the Joomla’s menu database table (MySQL / MariaDB).

To resolve the issue, I had to add the missing entry by running the following SQL command in phpMyAdmin MySQL admin portal:
Replace <prefix> with your Joomla’s database table prefix.
INSERT INTO <prefix>_menu (`id` ,`menutype` ,`title` ,`alias` ,`note` ,`path` ,`link` ,`type` ,`published` ,`parent_id` ,`level` ,`component_id` ,`checked_out` ,`checked_out_time` ,`browserNav` ,`access` ,`img` ,`template_style_id` ,`params` ,`lft` ,`rgt` ,`home` ,`language` ,`client_id` )
VALUES ( “1”, “”, “Menu_Item_Root”, “root”, “”, “”, “”, “”, “1”, “0”, “0”, “0”, “0”, “0000-00-00 00:00:00”, “0”, “0”, “”, “0”, “”, “0”, “0”, “0”, “*”, “0”)

After this, go back to the Joomla admin portal > Menus > All Menu Items and click the Rebuild button.

You should get the message: “Menu items list rebuilt“.
New menu items can now be added with no issues.

September 2023
Joomla 4.3.4
Leave a Reply