Opened 17 years ago
Closed 17 years ago
#6669 closed defect (bug) (fixed)
Notices when WP_DEBUG is set
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
Steps to reproduce:
- Define the constant WP_DEBUG in wp_config.php
- Select the edit link from a single post page which has no tags
- Check the PHP error log, and you should see:
Notice:Undefined variable: _wp_original_http_referrer in /Users/simon/Projects/WordPress-2.5/site/wp-admin/edit-form-advanced.php:6
Notice:Undefined variable: original_title in /Users/simon/Projects/WordPress-2.5/site/wp-admin/includes/post.php:639
Notice:Undefined property: stdClass::$args in /Users/simon/Projects/WordPress-2.5/site/wp-includes/taxonomy.php:1066
Notice:Undefined offset: 2 in /Users/simon/Projects/WordPress-2.5/site/wp-includes/rewrite.php(140) : eval()'d code:1
Notice:Undefined index: _wp_original_http_referer in /Users/simon/Projects/WordPress-2.5/site/wp-admin/edit-page-form.php:4
Notice:Undefined variable: temp_ID in /Users/simon/Projects/WordPress-2.5/site/wp-admin/edit-page-form.php:26
Notice:Undefined variable: post_ID in /Users/simon/Projects/WordPress-2.5/site/wp-admin/edit-page-form.php:32
The proposed patch, edit_posts_no_tags.patch, supresses the errors caused by trying to access unset $_GET vars, sets or tests other vars/properties before using them in I statements, lowers the error reporting before evaling $query in rewrite.php
Attachments (3)
Change History (22)
#1
@
17 years ago
- Keywords needs-patch added; has-patch removed
- Milestone changed from 2.5.1 to 2.6
- Owner changed from anonymous to westi
- Status changed from new to assigned
2.6 is a more appropriate target for these fixes.
Just adding @ is not the right fix.
#2
@
17 years ago
This most likely was fixed with another notices patch. I think there should only be one ticket for notices and warnings fixes per WordPress version.
#3
@
17 years ago
- Summary changed from Editing a post or page throws various Notices when WP_DEBUG is set to Notices when WP_DEBUG is set
#11
follow-up:
↓ 12
@
17 years ago
How about adding this to the top of the edit forms so that we don't have to do a bunch of isset checks later on?
if ( !isset($foo_id) ) $foo_id = 0;
#12
in reply to:
↑ 11
@
17 years ago
- Keywords needs-patch added; has-patch tested removed
Replying to ryan:
How about adding this to the top of the edit forms so that we don't have to do a bunch of isset checks later on?
Indeed.
@
17 years ago
Fixes a lot of notices in wp-admin and wp-includes directories with suggestion from Ryan, based off of r8584
#14
@
17 years ago
- Keywords has-patch tested needs-testing added; needs-patch removed
I did test the changes, but there might be some odd side effects possible with some changes. Works for me! Some pages are unusable without patch when using WP_DEBUG. We should encourage its use, but I really can't see how people will be able to use it.
There will need to be several more patches to cover the full scope of all of the Administration Panel pages, as well as the visitor pages.
Patch to reduce Notices when creating and editing pages/posts