Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#6669 closed defect (bug) (fixed)

Notices when WP_DEBUG is set

Reported by: simonwheatley's profile simonwheatley Owned by: westi's profile westi
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.5
Component: Administration Keywords:
Focuses: Cc:

Description

Steps to reproduce:

  1. Define the constant WP_DEBUG in wp_config.php
  1. Select the edit link from a single post page which has no tags
  1. 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)

edit.patch (4.4 KB) - added by simonwheatley 17 years ago.
Patch to reduce Notices when creating and editing pages/posts
6669.r8571.patch (16.2 KB) - added by santosj 17 years ago.
Fix massive amount of notices in wp-includes and wp-admin
6669.r8584.patch (24.4 KB) - added by santosj 17 years ago.
Fixes a lot of notices in wp-admin and wp-includes directories with suggestion from Ryan, based off of r8584

Download all attachments as: .zip

Change History (22)

@simonwheatley
17 years ago

Patch to reduce Notices when creating and editing pages/posts

#1 @westi
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 @jacobsantos
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 @jacobsantos
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

#8 @jacobsantos
17 years ago

  • Milestone changed from 2.9 to 2.7

@santosj
17 years ago

Fix massive amount of notices in wp-includes and wp-admin

#9 @santosj
17 years ago

Patch corrects a lot of notices.

#10 @santosj
17 years ago

  • Keywords has-patch tested added; needs-patch needs-testing removed

#11 follow-up: @ryan
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 @santosj
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.

#13 @santosj
17 years ago

  • Cc jacobsantos added

@santosj
17 years ago

Fixes a lot of notices in wp-admin and wp-includes directories with suggestion from Ryan, based off of r8584

#14 @santosj
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.

#15 @westi
17 years ago

Throwing the current patch at trunk.

#16 @westi
17 years ago

(In [8589]) Lots of fixes for Notices when WP_DEBUG is set. See #6669 props santosj.

#17 @santosj
17 years ago

Patch in this ticket fixed issues found in #7411.

#18 @santosj
17 years ago

  • Keywords needs-patch added; has-patch tested needs-testing removed

#19 @santosj
17 years ago

  • Keywords needs-patch removed
  • Resolution set to fixed
  • Status changed from assigned to closed

See #7509 for updated patch for WordPress notices.

Note: See TracTickets for help on using tickets.