Opened 13 years ago
Closed 13 years ago
#24577 closed defect (bug) (fixed)
Undefined index notice caused by default-widgets.php - WP_Widget_Recent_Posts
| Reported by: | jrf | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Widgets | Version: | 3.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
When updating the Recent Posts widget, it can cause an undefined index notice:
[14-Jun-2013 04:56:40] Backtrace from warning 'Undefined index: show_date' at /www/wp-includes/default-widgets.php 596: /www/wp-includes/widgets.php 232 calling update() <unknown file> <unknown line> calling update_callback() /www/wp-admin/includes/ajax-actions.php 1562 calling call_user_func_array() <unknown file> <unknown line> calling wp_ajax_save_widget() /www/wp-includes/plugin.php 406 calling call_user_func_array() /www/wp-admin/admin-ajax.php 72 calling do_action()
To fix, line 599 (based on current trunk):
$instance['show_date'] = (bool) $new_instance['show_date'];
would need to be replaced with:
$instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;
Patch file included.
Hope this helps ;-)
Attachments (1)
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Unified patch file for wp-includes/default-widgets.php