Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24462 closed defect (bug) (fixed)

ms_not_installed() does not report that wp_site does not exist

Reported by: creativeinfusion's profile creativeinfusion Owned by: nacin's profile nacin
Milestone: 3.6 Priority: normal
Severity: trivial Version: 3.0
Component: Multisite Keywords: has-patch commit
Focuses: Cc:

Description

ms_not_installed() does not report that $wpdb->site does not exist due to a logic error introduced in [14317]

if ( !$wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) )
  $msg .= '<p>' . sprintf( /*WP_I18N_TABLES_MISSING_LONG*/'<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really <em>should</em> look at your database now.'/*/WP_I18N_TABLES_MISSING_LONG*/, $wpdb->site ) . '</p>';
else
  $msg .= '<p>' . sprintf( /*WP_I18N_NO_SITE_FOUND*/'<strong>Could Not Find Site!</strong> Searched for table <em>%1$s</em> in <code>%2$s</code>. Is that right?'/*/WP_I18N_NO_SITE_FOUND*/, $domain . $path, DB_NAME, $wpdb->blogs ) . '</p>';

became

if ( false && !$wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) )
  $msg .= '<p>' . sprintf( /*WP_I18N_TABLES_MISSING_LONG*/'<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really should look at your database now.'/*/WP_I18N_TABLES_MISSING_LONG*/, $wpdb->site ) . '</p>';
else
  $msg .= '<p>' . sprintf( /*WP_I18N_NO_SITE_FOUND*/'<strong>Could not find site <code>%1$s</code>.</strong> Searched for table <code>%2$s</code> in <code>%3$s</code>. Is that right?'/*/WP_I18N_NO_SITE_FOUND*/, rtrim( $domain . $path, '/' ), DB_NAME, $wpdb->blogs ) . '</p>';

Suggest removal of extraneous "false" (i.e. revert that line) or just remove the redundant code.

Attachments (1)

24462.patch (1.1 KB) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
11 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 3.6

That looks like debug cruft.

#2 @nacin
11 years ago

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

In 24518:

Remove some old debug cruft left by yours truly. fixes #24462.

Note: See TracTickets for help on using tickets.