Make WordPress Core

Opened 20 years ago

Closed 20 years ago

#1124 closed defect (bug) (fixed)

User-added subpages whose last 10 characters are the same as an existing WP subpage will be highlighted incorrectly

Reported by: mc_incubus's profile MC_incubus Owned by: ryan's profile ryan
Milestone: Priority: normal
Severity: minor Version: 1.5.1
Component: Administration Keywords:
Focuses: Cc:

Description

class="current" is being improperly applied to all "Manage" user-added subpage tabs when the "Comments" subpage is selected.

None of the other "Manage" default pages cause this to happen... it appears to be limited to "Comments."

Attachments (1)

menu-header.php.diff (786 bytes) - added by MC_incubus 20 years ago.

Download all attachments as: .zip

Change History (9)

#1 @MC_incubus
20 years ago

  • Patch set to No

#2 @ryan
20 years ago

I can't make this happen with my menu test plugins. Can you provide a specific plugin that triggers the behavior?

#3 @MC_incubus
20 years ago

Aha! Figured it out. The plugin was a new version of Subscribe to Comments that I've been working on.

The plugin's filename is "subscribe-to-comments.php"

Changing it to "subscribe-to-comments2.php" and activating it fixes the problem.

WP must be recognizing "subscribe-to-comments.php" as "edit-comments.php"

#4 @ryan
20 years ago

It's because of the -10 substr we do in menu-header.php. Not sure why we do that.

#5 @MC_incubus
20 years ago

I went on a journey back through time.

The -10 substr stuff was added way back in August... back then the code was in menu.php instead of menu-header.php

http://trac.wordpress.org/changeset/1551

It seems we just want to see if one filename is the same as another. Why not a direct comparison? AFAIK, it should be stuff like "edit-comments.php" == "subscribe-to-comments.php"

I'm uploading a patch that changes to direct comparison. I've tested it with the menu-test.php from here:
http://codex.wordpress.org/Adding_Administration_Menus

I've seen no ill effects... it works as it should in all observable instances.

#6 @MC_incubus
20 years ago

  • Patch changed from No to Yes

#7 @MC_incubus
20 years ago

  • Summary changed from All user-added "Manage" subpages highlighted when "Comments" selected to User-added subpages whose last 10 characters are the same as an existing WP subpage will be highlighted incorrectly

#8 @ryan
20 years ago

  • fixed_in_version set to 1.5.1
  • Owner changed from anonymous to rboren
  • Resolution changed from 10 to 20
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.