Make WordPress Core

Opened 8 years ago

Last modified 14 months ago

#38057 reviewing enhancement

'wp_update_nav_menu' action returns inconsistent number of arguments

Reported by: barryceelen's profile barryceelen Owned by: johnbillion's profile johnbillion
Milestone: Future Release Priority: normal
Severity: normal Version: 4.6
Component: Menus Keywords: has-patch needs-testing
Focuses: Cc:

Description

The 'wp_update_nav_menu' action is fired in two places with a different amount of arguments.

The first one passes along the menu id and menu data, where the second one only returns the menu id.

Attachments (1)

38057.patch (4.5 KB) - added by keraweb 7 years ago.
Fix for action parameters with backwards compatibility

Download all attachments as: .zip

Change History (18)

@keraweb
7 years ago

Fix for action parameters with backwards compatibility

#1 @keraweb
7 years ago

  • Keywords has-patch dev-feedback added

#2 @johnbillion
7 years ago

  • Owner set to johnbillion
  • Status changed from new to reviewing

This ticket was mentioned in Slack in #core by helen. View the logs.


7 years ago

#4 @helen
7 years ago

  • Type changed from defect (bug) to enhancement
  • Version changed from trunk to 4.6

#5 @johnbillion
7 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to 4.8

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#8 @jbpaul17
7 years ago

  • Milestone changed from 4.8 to 4.8.1

Punting to 4.8.1 per today's bug scrub.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#10 @jbpaul17
7 years ago

  • Milestone changed from 4.8.1 to 4.9

Punting to 4.9 per today's bug scrub.

#11 @jbpaul17
7 years ago

  • Keywords needs-testing added

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#13 @johnbillion
7 years ago

  • Milestone changed from 4.9 to Future Release

@keraweb I know we discussed this in person, but can you refresh my memory on why the changes to the menu data were needed? Thanks!

#14 @keraweb
7 years ago

@johnbillion Wow this is a while ago.
From what I see the attribute keys were inconsistent at two locations where the same filter is used.

This fix makes it so that both locations where the filter is used will take the same array keys while maintaining backwards compatibility with the original situation.

Version 0, edited 7 years ago by keraweb (next)

#15 @SergeyBiryukov
4 years ago

#50208 was marked as a duplicate.

#16 @austyfrosty
3 years ago

Just found out about this defect. Was listing for the action hook with two params and got a fatal error. Luckily our QA caught this before moving to PROD. Would love to see some action on this.

#17 @vhiltunen
14 months ago

Found this still while investigating why two params caused a fatal error. There's another do_action( 'wp_update_nav_menu', $menu_id ) in file wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php.

Note: See TracTickets for help on using tickets.