Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#29743 closed task (blessed) (fixed)

warning with join in nav-menu-template.php (L 98) when apply_filters nav_menu_css_class return null

Reported by: eadoking Owned by: johnbillion
Priority: normal Milestone: 4.1
Component: Menus Version: 4.1
Severity: normal Keywords: needs-patch revert
Cc: Focuses:

Description

there is a warning because apply_filters on nav_menu_css_class return null and a warning happens in join clause , file "nav-menu-template.php" line 98

Attachments (1)

29743.diff (1018 bytes ) - added by briandichiara 12 years ago.
patch for nav-menu-template.php, resolves notices when non-array passed through filter

Download all attachments as: .zip

Change History (9)

@briandichiara
12 years ago

patch for nav-menu-template.php, resolves notices when non-array passed through filter

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


12 years ago

#2 @markjaquith
12 years ago

  • Keywords has-patch added

#3 @markjaquith
12 years ago

  • Owner set to markjaquith
  • Resolutionfixed
  • Status newclosed

In 30032:

Cast class names to an array to avoid a potential warning.

props briandichiara
fixes #29743

#4 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review4.1

#5 @SergeyBiryukov
12 years ago

  • Resolution fixed
  • Status closedreopened

there is a warning because apply_filters on nav_menu_css_class return null

I think this should be considered a developer error. If the goal is to remove the classes, __return_empty_array() should be used here instead of __return_null.

But if we're going to keep [30032], we should do the same for body_class, post_class, comment_class, and page_css_class filters as well.

Version 0, edited 12 years ago by SergeyBiryukov (next)

#6 @johnbillion
12 years ago

  • Keywords needs-patch added; has-patch removed
  • Owner changed from markjaquith to johnbillion
  • Status reopenedassigned
  • Type enhancementtask (blessed)

I would like to revert r30032. I agree with Sergey that this is a developer error and the warning is appropriate.

#7 @ocean90
12 years ago

  • Keywords revert added

#8 @johnbillion
12 years ago

  • Resolutionfixed
  • Status assignedclosed

Fixed in r30592.

Note: See TracTickets for help on using tickets.