WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 7 months ago

Last modified 7 months ago

#39138 closed defect (bug) (fixed)

wordpress 4.7 default theme does not get installed when upgrading

Reported by: christianebuddy Owned by: dd32
Milestone: 4.7.1 Priority: normal
Severity: normal Version: 4.7
Component: Bundled Theme Keywords:
Focuses: Cc:

Description

Wordpress 4.7 default theme does not get downloaded/installed when upgrading within wordpress or when upgrade is performed automatically.

Change History (9)

#1 @christianebuddy
8 months ago

Looks like the wordpress themes are in the downloaded zip file but do not get unpacked in the upgrade folder or copied to the needed location Have upgraded within wordpress backend several installations now, in English and in Dutch and neither of them installs the new default theme or updates the existing wordpress themes twenty sixteen, twenty fifteen etc...

#2 @Clorith
8 months ago

  • Component changed from Themes to Bundled Theme
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi,

This is expected behavior, the bundled theme is only available to first time installs, for existing sites we do not wish to be intrusive, and as such you have to go to the theme installer to download it your self (just searching for twenty seventeen should bring it up for you).

We'll look at perhaps relaying that better with future releases though :)

#3 @christianebuddy
8 months ago

Ok, tnx for the quick response. Did not know this.

#4 @dd32
7 months ago

  • Milestone set to 4.7.1
  • Resolution invalid deleted
  • Status changed from closed to reopened

This wasn't the intended effect for 4.7, see r39064 + #38551

TwentySeventeen was supposed to be installed, but hasn't been.

Pushing to 4.7.1 while I work out why, and what we want to do here.

#5 follow-up: @Clorith
7 months ago

Hmm, I thought the change was only for development builds to allow testing of new default themes.

I think I see why this is though.

The check at https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/update-core.php?rev=39064&marks=1047#L1047 short-circuit the install of new bundles if false, so we have some scenarios to look at depending on what is handling the $wp_filesystem->exists() check:

DirectFS and SSH2 does a check against file_exists( $file ), where a true value should end processing, and a false one should keep going (so in these two cases bundles won't be installed if they don't already exist)

FTPExt and FTPSocket appear to be the opposite and return false to end processing, and true to keep going (the behavior we are expecting in update-core.php right now).

#6 in reply to: ↑ 5 @dd32
7 months ago

Replying to Clorith:

Hmm, I thought the change was only for development builds to allow testing of new default themes.

The early ticket comments hints towards that, but we went all out and did it for all.

DirectFS and SSH2 does a check against file_exists( $file ), where a true value should end processing, and a false one should keep going (so in these two cases bundles won't be installed if they don't already exist)

FTPExt and FTPSocket appear to be the opposite and return false to end processing, and true to keep going (the behavior we are expecting in update-core.php right now).

That doesn't sound right.. It's checking to see if the files exist in the source (ie. the unziped files). The logic in all of the transports looks the same to me though, Direct/SSH file_exists, FTP: if directory, or file exists in directory listing

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


7 months ago

#8 @dd32
7 months ago

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

In 39687:

Upgrade: Fix the installation of TwentySeventeen upon upgrade from an early version.

This reverts part of [31124] which incorrectly caused $old_wp_version to equal the version of WordPress being upgraded to due to global variable access changes.

See #38551, #30799.
Fixes #39138 for trunk.

#9 @dd32
7 months ago

Traced this to [31124] which changed $old_wp_version from well, the old WP version to the version of WP being updated to.. so of course, new items didn't get installed because it thought WordPress had already updated past that point.

Merging this as-is to 4.7.1 will result in the following:

  • 4.6 -> 4.7.1: Twenty Seventeen will be installed.
  • 4.7 -> 4.7.1: Twenty Seventeen should've already been installed, and as such, is skipped.

Unfortunately I don't see a viable option here, any existing users who want Twenty Seventeen and have already updated to 4.7 just have to use the Theme Installer - which they probably have already done.

Note: See TracTickets for help on using tickets.