WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7966 closed defect (bug) (fixed)

Drop down menu with only one item?

Reported by: stevish Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.7
Component: Administration Keywords:
Focuses: Cc:

Description

I don't know whether to label this as a defect or enhancement, but either way, I'm not sure if it will make the 2.7 release. I'll assume enhancement (even though it's leaning toward defect to me).

In the current version of 2.7, the Dashboard menu in the sidebar of the administration page only contains one item: Dashboard. Therefore, when you go to your dashboard, there are two links in your sidebar that say the same thing, link to the same place, and are one on top of the other. This seems redundant, and is a waste of space on the sidebar.

There should be code implemented that does away with the "Drop-down" part of a menu with only one item (since clicking on the menu title will take you there anyway). This way, a fresh install of WP will not have the useless dashboard menu taking up space, but as soon as the user installs Akistmet (or any other plugin that puts another menu item under dashboard menu), the menu will regain its drop-down-ability, accommodating the new menu item.

This could also apply to a top level menu added by a plugin that only has one item in it (even though creating such a menu would be frowned upon).

Attachments (3)

7966.diff (1.3 KB) - added by ryan 5 years ago.
menu.patch (351 bytes) - added by alexrabe 5 years ago.
[9578] breaks top-level plugin menu
menu.png (5.3 KB) - added by alexrabe 5 years ago.
Menu failure with Firefox 3

Download all attachments as: .zip

Change History (17)

comment:1 ryan5 years ago

The new design eliminates some of the user experience reasons why this was needed. Now it's mainly a matter of the menu code being a colossal pain to fix.

ryan5 years ago

comment:2 ryan5 years ago

  • Milestone changed from 2.8 to 2.7

I think we fixed the bugs preventing us from going forward. Attached patch removes requirement for a submenu from the menu code. Styling fixes needed now.

comment:3 azaozz5 years ago

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

(In [9578]) Menu updates: single top level menus, B&W/color icons (sprite), fix for the Firefox bug of not firing mouseout on absolute positioned elements over textareas/text fields, scaling down properly for different user roles, includes patch by Ryan, fixes #7966

comment:4 ryan5 years ago

(In [9580]) Sort the menu before adding classes. see #7966

alexrabe5 years ago

[9578] breaks top-level plugin menu

comment:5 alexrabe5 years ago

  • Type changed from enhancement to defect

the changes in [9578] disappear the menu when you click on a top-level plugin menu . I tested three different plugins, to be sure. Checked with my plugin NextGEN-Gallery as well...

I didn't analyse very deep the function, but if I add the attched two lines, it will work again.

comment:6 ryan5 years ago

I don't see problems with NextGen-Gallery or any other plugins that add top levels. A screenshot and some browser info might help.

alexrabe5 years ago

Menu failure with Firefox 3

comment:7 alexrabe5 years ago

Failure happend when you click on the plugin's menu, not before.
Then all elements dissapear... Tested with CformsII & NextGEN Gallery & WP-Email under Firefox 3 and IE7

comment:8 ryan5 years ago

Those all work fine for me. Clicked all top-levels and submenus. Any JS errors?

comment:9 alexrabe5 years ago

Nope, Firebug didn't show up anything...Strange, I tested it only under XAMPP (PHP 4.4.7), let me switch over to PHP 5 and check it again... as I said I can get it working when I add the two lines, so it's not a JS issue...

comment:10 alexrabe5 years ago

Yep, under PHP 5.2 it's working for me, PHP 4.4 not...

comment:11 ryan5 years ago

Switched to PHP4 and can reproduce the problem. Very strange.

comment:12 alexrabe5 years ago

Time to drop PHP 4 :-)

comment:13 ryan5 years ago

Looks like the internal loop counter is being stomped. Dropping the pass-by-ref to _wp_menu_output() fixes the problem.

comment:14 ryan5 years ago

(In [9598]) Don't pass menus by ref. Causes loop counter problems in php4. fixes #7966

Note: See TracTickets for help on using tickets.