Skip to:

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7086 closed defect (bug) (fixed)

PHP Notice in Customizer

Reported by: djpaul's profile DJPaul Owned by: djpaul's profile djpaul
Milestone: 2.6 Priority: high
Severity: normal Version:
Component: Core Keywords: has-patch


When entering the email customiser, this appears in the preview pane. It didn't use to, so it's a regression or a change in WordPress we need to adapt for:

Notice: bp_setup_current_user was called <strong>incorrectly</strong>. The current user is being initialized without using $wp->init().
#6 /srv/www/ current_user_can('edit_theme_opti...')
#7 /srv/www/ WP_Customize_Widgets->construct(Object(WP_Customize_Manager))
#8 /srv/www/ WP_Customize_Manager->
#9 [internal function]: _wp_customize_include()
#10 /srv/www/ call_user_func_array('_wp_customize_i...', Array)
#11 /srv/www/ do_action('plugins_loaded')
#12 /srv/www/ require_once('/srv/www/buddyp...')
#13 /srv/www/ require_once('/srv/www/buddyp...')
#14 /srv/www/ require_once('/srv/www/buddyp...')
#15 /srv/www/ in /srv/www/ on line 3897

Attachments (1)

7086.01.patch (673 bytes) - added by r-a-y 8 years ago.

Download all attachments as: .zip

Change History (8)

#1 @slaFFik
8 years ago

#6926 and its comments.

#2 @DJPaul
8 years ago

Yes, I know, but this is a NEW instance since 2.5.0 and whatever version of WordPress I was using back then. We have exceptions in the code to prevent throwing this message on the Customizer, I am assuming they are broken or need tweaking.

#3 @slaFFik
8 years ago

I left that comment, because I like linked related issues (habit from using JIRA).
Sorry, if that was a wrong approach here.

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.

8 years ago

8 years ago

#5 @r-a-y
8 years ago

  • Component changed from API to Tools - Warnings/Notices
  • Keywords has-patch added

01.patch is a quick patch, which fixes the issue.

Patch adds checks on the $_SERVER{'REQUEST_URI'] as well as the referer for customize.php. If there's a match, we bail from the doing it wrong notice.

Not sure if there is a better fix for this...

Last edited 8 years ago by r-a-y (previous) (diff)

#6 @djpaul
8 years ago

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

In 10823:

Update the "bp_setup_current_user was called incorrectly" whitelist for the Customizer.

Change based on _wp_customize_include.
The previous approach was not working on recent versions of WordPress because the global wasn't set yet.

Fixes #7086

#7 @DJPaul
8 years ago

  • Component changed from Tools - Warnings/Notices to Core
Note: See TracTickets for help on using tickets.