WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#13703 closed defect (bug) (fixed)

Entering nothing adds a menu with name "Enter menu name here"

Reported by: GautamGupta Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

You might have guessed the problem, "Enter menu name here" should leave the textbox (if present) on form submit in the new menu creation area. Also the error message "A name is required for this term" should be changed (when you just put a " " in that textbox).

Attachments (3)

13703.diff (1.7 KB) - added by koopersmith 4 years ago.
13703.2.diff (1.2 KB) - added by koopersmith 4 years ago.
13703-better-menu-name-check.patch (1.3 KB) - added by ocean90 4 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 follow-up: GautamGupta4 years ago

Same goes for "Add to Menu" in Custom Links. Also an error message should pop if no link is provided (the user should get to know about the problem).

In the Pages & Categories, "Select All" should rename to "Deselect All" if all things have been selected, and vice versa. Also in Pages, search always returns no results even if you type the exact page name.

comment:2 GautamGupta4 years ago

  • Milestone changed from Unassigned to 3.0

comment:3 nacin4 years ago

  • Keywords needs-patch added
  • Severity changed from minor to normal

In testing, I've created my share of "Enter menu name here" menus.

koopersmith4 years ago

comment:4 koopersmith4 years ago

  • Keywords has-patch added; needs-patch removed

Patch provides validation and warnings for menu names in JS.

Note that in no-JS, on save menu, blank or whitespace-only names still trigger the "A name is required for this term" error and work in progress is lost.

comment:5 koopersmith4 years ago

  • Keywords needs-patch added

comment:6 in reply to: ↑ 1 ; follow-up: zerowolf4 years ago

Replying to GautamGupta:

Same goes for "Add to Menu" in Custom Links. Also an error message should pop if no link is provided (the user should get to know about the problem).

In the Pages & Categories, "Select All" should rename to "Deselect All" if all things have been selected, and vice versa. Also in Pages, search always returns no results even if you type the exact page name.

I would recommend making separate tickets for these

comment:7 in reply to: ↑ 6 ; follow-up: nacin4 years ago

Agreed on new tickets.

Feedback for "Add to Menu" it hasn't been brought up and we already are at the point where we are not blindly inserting "http://" links as menu items. Thus I see no reason for this to be done in 3.0.

It's different here -- In this case, without a patch, we're ending up with "Enter menu name here" menus.

Additionally, I see no reason for "Select All" to change its label. Again, it changing is minor to nearly useless UI, people realize what occurs, and if they don't, they are only losing their selection if *all* are already checked, and they can click it again.

koopersmith4 years ago

comment:8 in reply to: ↑ 7 GautamGupta4 years ago

Replying to nacin:

Feedback for "Add to Menu" it hasn't been brought up and we already are at the point where we are not blindly inserting "http://" links as menu items. Thus I see no reason for this to be done in 3.0.

I was saying about entering a URL and not entering a name (it takes up the textbox label name like the "Enter menu name here" one). Also, if you do not enter a URL (leave it as "http://"), then no error message comes nor the form submits - anyone of these needs to take place.

Additionally, I see no reason for "Select All" to change its label. Again, it changing is minor to nearly useless UI, people realize what occurs, and if they don't, they are only losing their selection if *all* are already checked, and they can click it again.

It would be better to also provide a Deselect Option for UI if you're providing a Select All option already - though it is not that necessary too.

There's already a ticket #13525, should I put these points in there or create a new ticket?

comment:10 nacin4 years ago

  • Keywords has-patch removed

Note that in no-JS, on save menu, blank or whitespace-only names still trigger the "A name is required for this term" error and work in progress is lost.

comment:11 ocean904 years ago

13703-better-menu-name-check.patch: I use trim() to remove the whitespaces and check then if it's not empty, if it's empty I use the old menu name. No work in progress is lost anymore.

comment:12 nacin4 years ago

If the new menu term clashes with another term however, you'd still see problems. That is probably more likely (given some sites with various menus and hundreds of cats and tags) than removing the menu name and clicking save.

comment:13 ocean904 years ago

  • Keywords has-patch added; needs-patch removed

comment:14 nacin4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15189]) Server-side check for an empty menu name on save. props ocean90, fixes #13703.

Note: See TracTickets for help on using tickets.