WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#32011 closed defect (bug) (fixed)

Install fail if DO_NOT_UPGRADE_GLOBAL_TABLES flag is true

Reported by: spacedmonkey Owned by: Oxymoron
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.1
Component: Upgrade/Install Keywords: good-first-bug has-patch
Focuses: Cc:
PR Number:

Description

WordPress fails to install with DO_NOT_UPGRADE_GLOBAL_TABLES flag set to true in wp-config.php file. There is no error message, you get to the final install screen, but the wp_user and wp_usermeta tables haven't created.

Attachments (2)

32011.patch (871 bytes) - added by Oxymoron 4 years ago.
Added error message if DO_NOT_UPGRADE_GLOBAL_TABLES is defined & true
Screen Shot 2015-06-03 at 1.23.44 AM.png (27.3 KB) - added by Oxymoron 4 years ago.
Screenshot of the error message 32011.patch adds

Download all attachments as: .zip

Change History (13)

This ticket was mentioned in Slack in #core by jorbin. View the logs.


5 years ago

#2 @jorbin
5 years ago

  • Keywords good-first-bug added

For this to happen you’d either have to create your own wp-config file before installation, or add that constant if WP can’t create it itself.

I think the answer for this is to display a warning on the install screen if DO_NOT_UPGRADE_GLOBAL_TABLES is defined as true. We have a precedent for this in src/wp-admin/network.php for displaying a message if you attempt to create a network with the constant defined.

#3 @jorbin
5 years ago

  • Milestone changed from Awaiting Review to Future Release

@Oxymoron
4 years ago

Added error message if DO_NOT_UPGRADE_GLOBAL_TABLES is defined & true

@Oxymoron
4 years ago

Screenshot of the error message 32011.patch adds

#4 @Oxymoron
4 years ago

  • Keywords has-patch added

#5 @obenland
4 years ago

  • Owner set to Oxymoron
  • Status changed from new to assigned

#6 @jorbin
4 years ago

  • Milestone changed from Future Release to 4.3

#7 @jorbin
4 years ago

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

In 32714:

Add error if a user attempts to install WordPress with DO_NOT_UPGRADE_GLOBAL_TABLES defined

The install process runs through migrations to global tables, therefore we cannot install WordPress with this constant defined. This error message prevents a false success screen from being seen.

Fixes #32011.
Props Oxymoron.

#8 @ocean90
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

We don't bother with truthiness for the DO_NOT_UPGRADE_GLOBAL_TABLES global, should be just if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) {}.

#9 follow-up: @jorbin
4 years ago

Actually we are fairly inconsistant.

Sometimes We just check for definition.
Other times we check for basic truthiness.

We may want to standardize on one or the other.

#10 in reply to: ↑ 9 @ocean90
4 years ago

Replying to jorbin:

We may want to standardize on one or the other.

#blamepento :-) #32154 covers the others.

#11 @jorbin
4 years ago

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

In 32715:

Remove Truthy check from DO_NOT_UPGRADE_GLOBAL_TABLES

Some, but not all, of the checks for DO_NOT_UPGRADE_GLOBAL_TABLES just check if it is defined, so checking for truthiness could cause the issue to not be fully fixed.

In the words of Colonel Jessep: You can't handle the truth!

Introduced in [32714]

Fixes #32011

Note: See TracTickets for help on using tickets.