Ticket #22856: 22856.7.diff

File 22856.7.diff, 1.1 KB (added by dd32, 5 months ago)
Line 
1Index: wp-admin/includes/update-core.php
2===================================================================
3--- wp-admin/includes/update-core.php   (revision 23246)
4+++ wp-admin/includes/update-core.php   (working copy)
5@@ -692,6 +692,15 @@
6                }
7        }
8 
9+       // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve.
10+       if ( '3.5' == $old_wp_version ) {
11+               if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' )  ) {
12+                       // Bumping the introduced version to 3.5.1 for the affected users causes Twenty Twelve to be installed for users
13+                       if ( $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' ) )
14+                               $_new_bundled_files[ 'themes/twentytwelve/' ] => '3.5.1';
15+               }
16+       }
17+
18        // Copy New bundled plugins & themes
19        // This gives us the ability to install new plugins & themes bundled with future versions of WordPress whilst avoiding the re-install upon upgrade issue.
20        // $development_build controls us overwriting bundled themes and plugins when a non-stable release is being updated