Skip to:
Content

Opened 20 months ago

Closed 20 months ago

Last modified 19 months ago

#7086 closed defect (bug) (fixed)

PHP Notice in Customizer

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

Description

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().
===
Trace:
#6 /srv/www/buddypress.dev/src/wp-includes/class-wp-customize-widgets.php(97): current_user_can('edit_theme_opti...')
#7 /srv/www/buddypress.dev/src/wp-includes/class-wp-customize-manager.php(266): WP_Customize_Widgets->construct(Object(WP_Customize_Manager))
#8 /srv/www/buddypress.dev/src/wp-includes/theme.php(2060): WP_Customize_Manager->
construct()
#9 [internal function]: _wp_customize_include()
#10 /srv/www/buddypress.dev/src/wp-includes/plugin.php(525): call_user_func_array('_wp_customize_i...', Array)
#11 /srv/www/buddypress.dev/src/wp-settings.php(277): do_action('plugins_loaded')
#12 /srv/www/buddypress.dev/wp-config.php(89): require_once('/srv/www/buddyp...')
#13 /srv/www/buddypress.dev/src/wp-load.php(42): require_once('/srv/www/buddyp...')
#14 /srv/www/buddypress.dev/src/wp-blog-header.php(13): require_once('/srv/www/buddyp...')
#15 /srv/www/buddypress.dev in /srv/www/buddypress.dev/src/wp-includes/functions.php on line 3897

Attachments (1)

7086.01.patch (673 bytes) - added by r-a-y 20 months ago.

Download all attachments as: .zip

Change History (8)

#1 @slaFFik
20 months ago

#6926 and its comments.

#2 @DJPaul
20 months 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
20 months 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.


20 months ago

@r-a-y
20 months ago

#5 @r-a-y
20 months 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 20 months ago by r-a-y (previous) (diff)

#6 @djpaul
20 months 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
19 months ago

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