I have a menu item called 'Home'

If I go to /admin/structure/menu/manage/main, I can see the item, but I can't delete it. All other menu items have a button that allows 'Edit' or 'Delete', however the Home menu item only allows 'Edit' or 'Reset'.

When I click Edit on this item, I'm warned "This link is provided by the Standard module. The title and path cannot be edited". Unfortunately there is no module called Standard, so as a noob this is confusing to me.

I've tried the suggested work around here: https://www.drupal.org/node/2838106#comment-11982227 but it didn't work.

I've also tried deleting the item from the database delete from menu_tree where id='standard.front_page';. This gets rid of the item from the menu editor, but the next cache reset, brings it back into the database, and back into the menu.

Any ideas what to do? Thanks! :)

Comments

CatsFromStonehenge created an issue. See original summary.

CatsFromStonehenge’s picture

Now I understand, although the warning message needs to be improved, and the fantastic looking patch they are working on at https://www.drupal.org/node/2838106#comment-11982227 completed.

Error messages, and warning messages, should not be in developer-speak. "This link is provided by the Standard module. The title and path cannot be edited" should be more human readable, maybe "This menu item is installed as standard, and can't be edited or deleted. If you want to change it, then it is recommended that you disable this menu item, and create a new one with a link of ''. This new one will be editable.'

The error message is long-winded, however it would have saved me a few hours. When writing warning or error messages we need to think about who the target audience is. We need to imagine the person reading it, knows a lot less than us.

I looked at the code, and I understand this error message is created in generic form:

    $form['info'] = array(
      '#type' => 'item',
      '#title' => $this->t('This link is provided by the @name module. The title and path cannot be edited.', array('@name' => $this->moduleHandler->getName($provider))),
    );

However I still recommend that we make this particular error message more readable.

cilefen’s picture

Title: Non-deletable menu item keeps returning » Improve message on trying to delete non-editable menu items
Issue tags: -database cache, -cache, -menus
Related issues: +#2838106: Standard profile: make "Home" menu link to <front> editable/deletable

Have you read the issue tag guidelines?