WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#28744 closed defect (bug) (fixed)

setup-config.php Fatal error: Cannot redeclare add_filter()

Reported by: michalzuber Owned by: nacin
Milestone: 4.0 Priority: normal
Severity: normal Version: 4.0
Component: Upgrade/Install Keywords:
Focuses: administration Cc:

Description

Without wp-config.php I get
Fatal error: Cannot redeclare add_filter() (previously declared in /Volumes/data/Sites/wp_git/wp-includes/plugin.php:82) in /Volumes/data/Sites/wp_git/wp-includes/plugin.php on line 89

Attachments (1)

setup-config.patch (916 bytes) - added by michalzuber 3 years ago.

Download all attachments as: .zip

Change History (5)

#1 @michalzuber
3 years ago

Issue is in wp-settings.php on line 75 there's only require. It conflicts with wp-admin/setup-config.php:33

#2 @SergeyBiryukov
3 years ago

  • Component changed from General to Upgrade/Install
  • Milestone changed from Awaiting Review to 4.0

Confirmed. See [28978].

With setup-config.patch, wp_load_translations_early() never fires, it's added too late.

I guess we need to change require() to require_once() in wp-settings.php.

#3 @nacin
3 years ago

Weird. I thought this was already a require_once(), and it was working for me. Turns out it was due to a buggy opcode cache. (This was less than fun to track down.)

#4 @nacin
3 years ago

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

In 29005:

Don't include plugin.php twice in setup-config.php.

fixes #28744. see #28740, [28978].

Note: See TracTickets for help on using tickets.