Opened 10 years ago
Closed 9 years ago
#38856 closed enhancement (fixed)
Backward compat consideration for wp_blogs.archived
| Reported by: | stephdau | Owned by: | jeremyfelt |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Networks and Sites | Version: | 4.7 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | multisite |
Description (last modified by )
The archived column in wp_blogs used to be of the enum data type, but was switched to tinyint 3 years ago, in r25448.
Some older instances might not have migrated to the newer data type (ALTERs on large tables isn't fun).
In class-wp-site-query.php, we use $wpdb->prepare( "archived = %d ", $archived );, which translates to archived = 0|1. Tis works great with tinyint, but fails with the older enum type, as it expects the value to be single quoted.
Since archived = '0|1' works with both data types, @jeremyfelt suggested we move the prepare() statement to using %s and absint() instead: https://wordpress.slack.com/archives/core-multisite/p1479504691000517
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #27832