WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#5605 closed defect (bug) (fixed)

r6567 breaks wp-admin

Reported by: christianthheim Owned by: mdawaffe
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.5
Component: Administration Keywords: has-patch commit
Focuses: Cc:

Description

r6567 (probably the change to wp-includes/general-template.php) breaks the wp-admin area.

PHP ends up reviewing this:
PHP Fatal error: Call to undefined function wp_get_current_user() in /var/www/blog/wp-includes/user.php on line 30

Attachments (1)

5605.diff (1022 bytes) - added by mdawaffe 7 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 @mdawaffe7 years ago

I cannot reproduce this fatal error. Where in the admin is it broken?

Are you sure you have a complete and up to date SVN checkout?

comment:2 in reply to: ↑ description @gotgot7 years ago

Replying to christianthheim:

r6567 (probably the change to wp-includes/general-template.php) breaks the wp-admin area.

PHP ends up reviewing this:
PHP Fatal error: Call to undefined function wp_get_current_user() in /var/www/blog/wp-includes/user.php on line 30

I've the same error. Downgrading to 6563 solves the problem.

comment:3 follow-up: @mdawaffe7 years ago

Do either of you have any plugins installed? Try disabling them to see if there is a conflict there.

comment:4 in reply to: ↑ 3 @gotgot7 years ago

Replying to mdawaffe:

Do either of you have any plugins installed? Try disabling them to see if there is a conflict there.

Oh, yes. It's right! It was the "Optimize DB" plugin that produced that error. Disabling it resolved the problem.

Thank you.

comment:5 @lloydbudd7 years ago

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

comment:6 @ryan7 years ago

No idea why that plugin would cause this. Weird. Line 30 is in get_user_option().

comment:7 @devil15917 years ago

the bug comes from line 36 in the optimize-db.php file from the plugin

wp_enqueue_script('prototype');

see ticket #5612 for more info

comment:8 @ryan7 years ago

wp_default_editor() is being called when WP_Scripts is constructed. This function gets the current user. When a plugin calls one of the script-loader functions, WP_Scripts is constructed before the current user is setup. The error will occur even if a script waits until init to use the script loader. Addressing #4181 would help that, but plugins that were unconditionally registering scripts will still break.

comment:9 @ryan7 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

comment:10 @lloydbudd7 years ago

  • Milestone set to 2.5
  • Version set to 2.5

@mdawaffe7 years ago

comment:11 @mdawaffe7 years ago

  • Keywords has-patch commit added
  • Owner changed from anonymous to mdawaffe
  • Status changed from reopened to new

5605.diff

Just in Time localization.

comment:12 @ryan7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6587]) JIT load tinymce localization to avoid load order problems. Props mdawaffe. fixes #5605

Note: See TracTickets for help on using tickets.