| Anonymous | Login | Signup for a new account | 06-09-2026 11:51 PDT |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0004929 | [Quercus] | major | always | 01-24-12 06:39 | 06-21-12 01:23 | ||||
| Reporter | jgilje | View Status | public | ||||||
| Assigned To | nam | ||||||||
| Priority | normal | Resolution | unable to reproduce | ||||||
| Status | closed | Product Version | 4.0.14 | ||||||
| Summary | 0004929: Array is passed as reference, even though function is defined as pass-by-value | ||||||||
| Description |
Using the latest version of wordpress, I had trouble using the page-editor. On wp-admin/edit.php?post_type=page no edit links appear. I narrowed the bug down to the global variable $wp_post_types getting corrupted by the callstack starting at wp-admin/includes/post.php - line 852 - call to get_post_types(); wp-includes/post.php - line 854 - call to wp_filter_object_list(); wp-includes/functions.php - 3228 - call to wp_list_pluck(); wp-includes/functions.php - 3286 - definition of wp_list_pluck(); After the call to wp_list_pluck(), $wp_post_types is corrupted. However, if changing the function wp_list_pluck() to create a copy of its $list parameter as follows function wp_list_pluck( $list, $field ) { $ret = array(); foreach ( $list as $key => $value ) { if ( is_object( $value ) ) $ret[ $key ] = $value->$field; else $ret[ $key ] = $value[ $field ]; } return $ret; } it works perfectly. To me, this seems as the $list variable passed to wp_list_pluck() is assigned by reference and not by value through the callstack coming from get_post_types() in wp-includes/post.php - even though the functions involved does not specify pass-by-reference. |
||||||||
| Additional Information | |||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
Notes |
|
|
(0005918) nam 06-21-12 01:23 |
Unable to reproduce on 4.0.29. Tested wordpress-3.3.1. I am seeing edit links for the edit.php page. |
| Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 26 unique queries executed. |