WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#29389 closed defect (bug) (invalid)

Notices in General Settings

Reported by: SergeyBiryukov Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: I18N Keywords: has-patch
Focuses: administration Cc:

Description

Seeing notices from Debug Bar on General Settings screen after [29630]:

Notice: Undefined offset: 5 in wp-content/plugins/debug-bar/panels/class-debug-bar-deprecated.php on line 89
Notice: Undefined offset: 4 in wp-content/plugins/debug-bar/panels/class-debug-bar-deprecated.php on line 92
Notice: Undefined offset: 4 in wp-content/plugins/debug-bar/panels/class-debug-bar-deprecated.php on line 93

Caused by:

_deprecated_argument( 'define()', '4.0', sprintf( __( 'The %s constant in your %s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );

Although the notices come from Debug Bar and not from WordPres core, apparently _deprecated_argument() should only be called inside a function. We should probably replace it with _doing_it_wrong().

Attachments (1)

29389.patch (3.0 KB) - added by SergeyBiryukov 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 @nacin
7 years ago

ocean90 and I knew about this before commit. I was going to simply patch Debug Bar and Log Deprecated Notices (they use the same backtrace code) to handle this. I gathered it was because it wasn't from inside a function. But it didn't fully occur to me the irony of using _deprecated_argument() outside a function. I'm not sure I like the message that _doing_it_wrong() sends, though that would be much easier. I'm open to ideas.

#2 @SergeyBiryukov
7 years ago

Introduce a _deprecated_constant()?

#3 @nacin
7 years ago

Not sure I care enough. :) But I guess we do have at least two now (and, really, more).

#4 @SergeyBiryukov
7 years ago

  • Keywords has-patch added

29389.patch introduces _deprecated_constant() and uses it for WPLANG.

This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.


7 years ago

#6 @nacin
7 years ago

  • Milestone 4.0 deleted
  • Resolution set to invalid
  • Status changed from new to closed

I fixed this in Log Deprecated Notices 0.3 and Debug Bar 0.8.2. The conversation in #29456 may yet take another turn, also. I'm closing this ticket out.

Note: See TracTickets for help on using tickets.