Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#4961 closed defect (bug) (wontfix)

multiple wp_dropdown_categories broken

Reported by: pixline Owned by: westi
Priority: normal Milestone:
Component: General Version: 2.2.3
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Writing a complex template management panel, I've found that is impossibile to use multiple wp_dropdown_categories because of a function called stamp_cat() , that is located inside &get_categories() and re-instanziated every dropdown request. This produce errors like:

Fatal error: Cannot redeclare stamp_cat() (previously declared in /Users/gomez/Sites/wpmu/wp-includes/category.php:99) in /Users/gomez/Sites/wpmu/wp-includes/category.php on line 99

I moved stamp_cat outside &get_categories, and it works for me. I've also made a patch for that, but I'm not sure if this can have some downside in other areas (maybe there's a reason for stamp_cat to be there, and I simply can't know it).

Bug first reported on <a href="http://trac.mu.wordpress.org/ticket/420">WPMU Trac</a>, and bounced back here because is a shared issue.

Attachments (2)

category.php-patch_wp (822 bytes ) - added by pixline 19 years ago.
patch for category.php against WP 223
category.php-patch_wpmu (816 bytes ) - added by pixline 19 years ago.
patch for WPMU against 1.2.5

Download all attachments as: .zip

Change History (8)

@pixline
19 years ago

patch for category.php against WP 223

@pixline
19 years ago

patch for WPMU against 1.2.5

#1 @westi
19 years ago

  • Milestone 2.4 (next)2.3
  • Owner changed from anonymous to westi
  • Status newassigned
  • Version2.2.3

Hmm.

-1 to globalising stamp_cat unless it is really needed elsewhere.

It looks like stamp_cat should be a lambda function really using create_function

#2 follow-up: @pixline
19 years ago

Can you explain me why? I can't understand it, and I just want to learn about it.

The patches I've submitted are just a shared working hack for my project, because I need to make it work *now*, but I can't understand what kind of issue may be caused by globalizing that function.

#3 in reply to: ↑ 2 @westi
19 years ago

  • Milestone 2.32.2.3

Replying to pixline:

Can you explain me why? I can't understand it, and I just want to learn about it.

The patches I've submitted are just a shared working hack for my project, because I need to make it work *now*, but I can't understand what kind of issue may be caused by globalizing that function.

There is not a specific issue with globalising the function.

The reason for using create_function is the function has a very specific purpose - to be passed to array_map and so using create_function is cleaner IMHO.

Removing from the 2.3 milestone as this code no longer exists in 2.3

#4 @westi
19 years ago

Closing as WONTFIX as we are now working on 2.4 (and bug fixes for 2.3 (and security fixes for 2.0)) the above code doesn't appear in trunk, branches/2.3 or branches/2.0

#5 @westi
19 years ago

  • Resolutionwontfix
  • Status assignedclosed

#6 @foolswisdom
19 years ago

  • Milestone 2.2.3
Note: See TracTickets for help on using tickets.