Problem

Menus allow for multiline input as the menu description. However the text is only ever displayed in the admin overview table for menus, which would especially look odd with multiline text. There is no other (core) use for this text.

Screenshot_2_25_13_12_07_PM 2.png

Proposal

Make the description a regular one-line textfield and explain it is used as an admin description. Such as Views does, labeling as "View description" and explaining as "This description will appear on the Views administrative UI to tell you what the view is about.".

Screenshot_2_25_13_12_07_PM.png

This issue came up in #663946: Merge "List links" page into "Edit menu" page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Status: Active » Needs review
FileSize
794 bytes

Initial patch. Needs upgrade path for truncating existing descriptions, which is why it was not solved in #663946: Merge "List links" page into "Edit menu" page right away. Marking needs review for bot.

sun’s picture

How about changing the label to "Administrative summary" and omitting the description?

Gábor Hojtsy’s picture

That works for me as well. I just got inspiration from Views :)

Gábor Hojtsy’s picture

Issue tags: +Needs upgrade path
FileSize
704 bytes

With the suggested change. Still needs upgrade path. Anybody wanna take a crack at that? :)

sun’s picture

Status: Needs review » Reviewed & tested by the community

I don't really see what kind of upgrade path would be required (or even possible) here. Any newlines will simply vanish, but the former value is still fully contained in the textfield.

chx’s picture

Well theoretically you could run an UPDATE description=REPLACE(description, "\n", ' ') for an update path but let's NOT do that. It's pointless and problematic.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs review

See #663946-73: Merge "List links" page into "Edit menu" page for the upgrade issues. It doesn't quite destroy data or anything, but leaves it kind of broken nonetheless.

Gábor Hojtsy’s picture

Copying here for posterity, quoting David:

I think the issue with the upgrade path is the same one I was referring to in #51.

More specifically:

  1. Existing sites with newlines in their menu descriptions will have them disappear when loaded into the textfield (not so terrible actually, but it does cause sentences to run together - I think we need to convert the newlines to a space on upgrade).
  2. Bigger issue: Any existing menu description longer than 128 characters cannot be re-saved, since the textfield has a maxlength of 128.
sun’s picture

Let's not over-engineer this. I've yet to see any kind of "advanced" usage of menu descriptions.

In fact, almost all sites I've ever seen completely ignored the menu descriptions, because the only place they're output is on the administrative listing of menus, which almost no one ever sees. The usefulness of these descriptions is close to zero, and the values actually rather map to "technical site builder notes" that are logged for posterity, so as to answer the question of: "Why did I create this menu again...? - Ah, I see. - That no longer exists though, looks like we can delete this menu?"

Thus, on #8:

1) Let's simply ignore that. People can manually update their administrative summaries. That's not the end of the world.

2) The descriptions are stored in config now. We can apply a #maxlength of 255, or even 1000, or even 10,000, if we wanted to. YAML does not care. I'd recommend to go with something sensible though; e.g., <=512.

Also note that #maxlength is ultimate/final. Browsers cut off an existing default value that exceeds the maximum length.

Gábor Hojtsy’s picture

Issue tags: +sprint

Any other opinions?

Wim Leers’s picture

+1 for #9, "lets' not over-engineer this". I also have never seen any kind of "advanced" usage of menu descriptions. In fact, most sites I've seen have *empty* menu descriptions.

sun’s picture

I actually would have proposed to remove the descriptions entirely, if there wasn't a single use-case for which they are actually helpful — which is the first-time Drupal evaluation experience: For people who are looking at Drupal for the first time, these administrative descriptions help to understand what those menus are supposed to contain.

That said, with the new Tour module in core, one could reasonably argue that these could as well be tips...

Gábor Hojtsy’s picture

I think single line descriptions are useful when creating menus on the site, leaving notes for other site builders. Multilingual sites, eg. sometimes need different menus for languages if they want different structures. So creating numerous custom menus is a reasonable thing to expect. I don't think a multiline description has a use case or that people used this in practice. Theoretically they maybe did dealing with it being our question :)

sun’s picture

OK, how about quickly adding a #maxlength of 512 and call this done?

Gábor Hojtsy’s picture

FileSize
731 bytes

Here it is.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

Wim Leers’s picture

Nice & simple :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Nice and simple clean-up. The upgrade path is a bit of a bummer, but it seems a fairly good case has been established for why we might not need to worry about that in this case. I too have never seen this expanded out beyond a few words.

Committed and pushed to 8.x. Thanks!

David_Rothstein’s picture

A default installation of Drupal 6 actually gives you some very long ones out of the box (e.g., for the Navigation menu) but the longest looks to be 225 characters. I guess that means 512 is likely to cover most real life cases.

I'm not convinced people won't run into problems with this though. It is hard to imagine no one has ever deliberately started a new paragraph in this field in the history of Drupal? :) And there are a number of forum posts and code snippets about "how can I display my menu descriptions underneath the menu title on the front end of my site" so I don't think this is being used for administrative descriptions only (even though that's clearly the majority case).

Winn’s picture

I don't really see what problem or usability issue this is solving. The menu edit form is very short and will not benefit significantly from the added space savings. I agree that more accurate labeling in a good thing, but what's the harm in a multi-line text box?

Gábor Hojtsy’s picture

Winn: its shortness depends on the number of menu items you have in the menu which are all displayed below the main menu properties.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Gábor Hojtsy’s picture

Issue tags: -sprint

Landed, remove sprint tracking.