Environment: 7.x-dev 2010-10-30 fresh install on Windows 7/IIS7.5/MySql 5.1/PHP5.2.14/FastCGI

Steps to reproduce:
- create a node
- create a menu
- add link for node to menu
- edit node, change text format, save node
Result: menu item for node is removed from menu. The record has been deleted from menu_links.

Comments

taslett’s picture

Hi johandw,
I don't have that problem in 7.x-dev on ubuntu.
It shouldn't be an environment issue although anything is possible.
When I create the node, then create a menu item for that node, editing the node shows the menu item. Then changing the input format and saving the menu item still exists.

Could it possible be a cache issue?
Or did you open the menu and node in different browser tabs and not reload.
Or is it possible you deselected the 'Provide a menu link' checkbox when editing.

Can you replicate the issue, and if so what input formats are you changing from and to.

ygerasimov’s picture

I can't reproduce niether.

What might happened that another user that has no access rights to view nodes with selected format tried to look to menu.

@johandw Please advise whether this happened with admin user only or you have tried to open your site as anonymous?

Jonathan Webb’s picture

Title: Changing the text format of a node deletes menu links to this node » node_form forces menu items to have Main Menu as parent item
Priority: Normal » Major

I followed johandw's steps and was able to reproduce the issue in D7 head. It has nothing to do with the text format. node_form is only loading the main menu (regardless of what menus are set for the node, or available). So unless your link is on the main menu, you either have to move it there or delete it! Upping this to major. I suspect the issue is with menu_node_prepare().

marcingy’s picture

Priority: Major » Normal

No it doesn't the issue is caused by the fact that you have created a new menu and then have not defined this menu as being available for the content type under admin/structure/types/manage/xxx. This results in the menu item being associated with main menu as that is the only menu option that has been available.

Maybe we need some warnings displayed somewhere but this works correctly. Downgrading to normal.

yukare’s picture

Priority: Normal » Major

Since my other report http://drupal.org/node/1009952 was marked as duplicate, i am posting here:

Drupal let you create content and after delete it without any warning? This is not important?

I really do not like this change, but drupal must never let me create a content that it will delete after, it must tell that is not possible for me create a menu item if i do not set it in content type. The same thing occurs when you do not have permission to create a node, drupal tell you BEFORE you write it, not delete it after you write, and its bug like a security thing too because i can create the menu, and it is visible on my page, the only thing is that after the menu exist, i can not change the content of node.

marcingy’s picture

Priority: Major » Normal

See http://drupal.org/node/957784#comment-3702222 this is not major, yes maybe a warning of some form should be shown but the issue is that the menu has not be enabled as being available for the given node type as a result the option isn't available. It isn't a security issue the problem is that you haven't said menu X is available for content type Y.

gaele’s picture

Issue tags: +User interface

Interesting. This is an inconsistency in the user interface.

  1. At admin/structure/types/manage/<content-type> under "Menu settings" one can enable menus that will be available on the node edit page.
  2. However, at admin/structure/menu/manage/<menu>/add one can add any path, disregarding step 1.

Steps to reproduce:

  1. add link for a node to a menu not enabled at admin/structure/types/manage/<content-type>
  2. edit and save the node
  3. node is gone from menu in step 1 (and may appear in one of the enabled menus)

Ideally we should prohibit the user from making the error. In step 1 or step 2?

yukare’s picture

So why this change then? Why i have to make a menu available to a content? It is not to limit where users can create a menu for a specif content, as they can create any menu for any content as long you do not edit the content.

gaele’s picture

Why do i have to make a menu available to a content?

To make the node edit page easier to use. There can be a lot of menus, each with a lot of entries. All of these would appear in a very long drop down box if you don't limit the available menus. Often only one of the menus would be an appropriate choice for the node being edited, so the other options would be useless.

Unfortunately this usability improvement on the node edit page created a usability bug elsewhere (the one discussed here).

yukare’s picture

This could be changed to alow the creation of any menu item for any content type when you create the menu item direct in the block and to limit which menus appear on node edit, but NOT to restrict to it, if done as this, will be a good improvement.

jn2’s picture

Issue tags: -Usability

Seems it would be easier to understand and avoid most of these issues with the default reversed. In other words,
include all menus in each content type and allow the site builder to remove access to chosen menus.

gaele’s picture

Issue tags: +Usability

so this issue shows up in the right issue lists

ceardach’s picture

Priority: Normal » Major
Issue tags: +Usability

I'm upping the priority because this is a horrible usability issue.

I just made a quick simple little site last night as my very first D7 install: http://trainingtaedyn.com/

It's just a couple of tabs, a panel page, a couple view pages, a node and the contact form. This, I believe, is a common use case, especially for beginners.

When I created the content types, I disabled the menu association for the 'page' content type. Why? Well, I was confused as to why it was even there. I actually thought it was the menu that should be in the active-menu-trail for nodes of that content type (now that would be a cool feature).

So I create my panel and views, and then go to the main menu edit form and add links to my 'about' node and the contact form. Then I edit the 'about' node and the menu item disappears. WTF? I spent quite awhile extremely frustrated with this until for some unknown reason I stumbled upon the recipe of enabling the menu association for the 'page' content type. In fact, I almost gave up pretty upset that I couldn't set up a simple menu and have it stay that way.

These two phenomenon should not be linked. If I want to add an easy way for users to add pages to a menu, then great! Have an option to expose a UI to the user. However, if I want to add any random node to any random menu, regardless of its menu configuration, then I should be able to do that.

mlncn’s picture

Title: node_form forces menu items to have Main Menu as parent item » Saving node_form removes any menu items that are not in one of the Available menus

This is a fairly serious bug, not just a confusing UI. The menus that appear on a node form are, in my opinion, about having a cleaner UI, not preventing an administrator from placing a page in any menu she wants.

If an administrator no longer wants pages assigned to a menu from page nodes, that does not mean she wants existing links silently deleted when she or anyone else edits those pages. There is no permissions alternate way to do set up this common use case.

benjamin, agaric

jn2’s picture

How to deal with menus in D7, taking this aspect of the interface into account, is now documented in Add a menu. I've also documented it at Add a link to a menu.

It can be frustrating, but everything works if you know to enable the menu in the nodes' content type(s) before adding the links.

That's not to say there shouldn't be some kind of warning or other change to make this work better.

ceardach’s picture

An admin should be able to add any node to any menu and have it stay there, regardless of the exposed (or not exposed) menu ui on the node form. It is made worse by allowing a node to be added to any arbitrary menu and then having it removed upon node edit.

Seriously, this is a significant feature reduction if we do not allow admins to add arbitrary nodes to arbitrary menus and have that be separate from the exposed form UI.

Jej’s picture

We (http://drupal.org/node/1033058, duplicate of this issue) subscribe too!

hansfn’s picture

+1 to what ceardach said in #16 above. It's spot on. I know it doesn't help to yell, but I really feel like it.

Just for illustration: I'm giving a introductory course to Drupal (7) for 50 student in a web design course at our college, and disappearing menu items (after node save) was the biggest problem ...

gaele’s picture

AshleyF73’s picture

I want to echo others. This is a major show stopping issue. How can it be acceptable to edit a node page, maybe for a typo and then saving that see the page removed from a menu.

deastlack’s picture

Status: Closed (duplicate) » Active

seems to me that all menus should be "on" by default and that any new menu should be automatically added in the on aka available mode.

having to select the available menus is counter intuitive and the source of countless headaches and product dissatisfaction.

design re-think needed asap!

catch’s picture

Status: Active » Closed (duplicate)

If you want to change the default behaviour, please open a new issue against Drupal 8 rather than trying to re-purpose this one.