Skip to content

Site properties in wp_blogs must be integers#3414

Merged
dereksmart merged 1 commit intoAutomattic:masterfrom
kovshenin:patch-1
Feb 17, 2016
Merged

Site properties in wp_blogs must be integers#3414
dereksmart merged 1 commit intoAutomattic:masterfrom
kovshenin:patch-1

Conversation

@kovshenin
Copy link
Copy Markdown
Contributor

It looks like #2381 broke some WordPress installations with outdated database schemas.

The archived column used to be an enum and not a tinyint, so when selecting archived = '' it returns no rows. A couple of ALTER TABLE statements fixes the bug (though I haven't tested with strict SQL mode) but it's easy enough for us to take care of that by providing integer values instead of empty strings. It's what core does in wp_get_sites() too.

@jeherve jeherve added Bug When a feature is broken and / or not performing as intended [Focus] Multisite [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Feb 16, 2016
@jeherve jeherve added this to the 3.9.2 milestone Feb 16, 2016
@jeherve
Copy link
Copy Markdown
Member

jeherve commented Feb 16, 2016

Related: 5b6bbc0

@zinigor
Copy link
Copy Markdown
Contributor

zinigor commented Feb 16, 2016

@kovshenin thanks for the PR! It turns out that we have another PR that looks like it will solve your problem: #3405. Can you please test it and see if it's good for that old schema?

@kovshenin
Copy link
Copy Markdown
Contributor Author

wp_get_sites() will work fine, though I'm not entirely sure why you're currently excluding blog_id = 1 or offsetting 1 in #3405. If you're trying to exclude the main site in the network, you should be using BLOG_ID_CURRENT_SITE (which will likely be the equivalent of get_current_blog_id() if you're looking at the network admin) and not 1.

@zinigor
Copy link
Copy Markdown
Contributor

zinigor commented Feb 16, 2016

OK, thanks for taking a look! We'll get one of those solutions in for 3.9.2.

@zinigor zinigor added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Feb 17, 2016
@zinigor
Copy link
Copy Markdown
Contributor

zinigor commented Feb 17, 2016

Let's get this in for 3.9.2 and then deal with the other PR for 4.0.

dereksmart added a commit that referenced this pull request Feb 17, 2016
Site properties in wp_blogs must be integers
@dereksmart dereksmart merged commit d5dbe5f into Automattic:master Feb 17, 2016
@dereksmart dereksmart removed the [Status] Ready to Merge Go ahead, you can push that green button! label Feb 17, 2016
@kovshenin kovshenin deleted the patch-1 branch April 1, 2016 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Focus] Multisite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants