WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 3 years ago

#7965 new enhancement

Database upgrade complete message should be an admin notice

Reported by: westi Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:

Description

When a database upgrade is complete we should just take you to the page you wanted to see and should an upgrade_complete admin notice instead of requiring another button click

Attachments (1)

7965.diff (5.9 KB) - added by nacin 4 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 @ryan6 years ago

The db_upgraded option that is checked in admin.php makes this easier.

comment:2 @ryan6 years ago

  • Component changed from Administration to Upgrade/Install
  • Owner anonymous deleted
  • Type changed from defect (bug) to enhancement

comment:3 @Denis-de-Bernardy6 years ago

  • Milestone changed from 2.8 to Future Release

comment:4 @johnbillion5 years ago

  • Cc johnbillion@… added

comment:5 @nacin4 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 3.3

After some discussion, we don't actually need any more UI here at all. Database upgrades are never intensive anymore, and if they ever would be for some major migration in the future, we can either add code back or do it in some async fashion. And they're safe.

Attached patch neuters upgrade.php and moves relevant upgrade code to admin.php. The upgrade.php file can't strictly be deleted since multisite still uses it.

At some point it would be nice to not be calling delete_site_transient() on ever multisite call, and to eventually just kill off this file.

@nacin4 years ago

comment:6 @dd324 years ago

Patch seems to work for me, I've only tested on a Single site instance however.

The only things which it doesn't catch, is

  • Notifying the user that an upgrade took place
  • Notifying the user of any errors which occurred during the upgrade

Occasionally with WP_DEBUG enabled, I'll see Database errors (ie. Index already defined) that sort of thing is going to be missed with this patch added. Whilst it's not going to be an issue for small sites, it could theoretically cause an issue for some.

I feel like using the Settings Notice API for the latter part somehow..

comment:7 @nacin4 years ago

Since we normally trigger it without showing error messages, I'm not sure capturing these is worth the extra development.

comment:8 @nacin4 years ago

Looks like the patch might need a tweak in the multisite branch. Just a matter of unifying it in terms of require's, etc.

comment:9 @dd324 years ago

Since we normally trigger it without showing error messages, I'm not sure capturing these is worth the extra development.

That's a fair enough point. The redirection will have to be issued before the upgrade takes place then, to ensure that output from functions doesn't cause 'headers already sent' issue.

comment:10 @jane3 years ago

  • Milestone changed from 3.3 to Future Release

Punting as we're in beta 2, long past enhancment stage. Can revisit for 3.4.

comment:11 @navjotjsingh3 years ago

  • Cc navjotjsingh@… added
Note: See TracTickets for help on using tickets.