From a90c4761c4c1bb9cf8e457e1b46078e8d07a245d Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 3 Jul 2018 11:59:18 -0400 Subject: [PATCH] Fix error in various deprecated selectFields() methods When aliasing a field to null, it has to be aliased to the string 'NULL' rather than PHP null. Bug: T198687 Change-Id: I6096f306b97022da781eaabeb15e502f391673a9 (cherry picked from commit 377ce5a469476a0ec68a6f03e3f5714eb40caeff) --- RELEASE-NOTES-1.31 | 1 + includes/Block.php | 2 +- includes/filerepo/file/ArchivedFile.php | 2 +- includes/filerepo/file/LocalFile.php | 2 +- includes/filerepo/file/OldLocalFile.php | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index c05efe9fc2..9d8f387d6c 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -5,6 +5,7 @@ THIS IS NOT A RELEASE YET! === Changes since MediaWiki 1.31.0 === * (T197229) Bundle Nuke extension, it was accidentally omitted. * (T193995) Fix undefined patchPath() method call in parser tests. +* (T198687) Fix various selectFields methods to use the string 'NULL', not null. === Changes since MediaWiki 1.31.0-rc.2 === * (T195783) Initialize PSR-4 namespaces at same stage as normal autoloader. diff --git a/includes/Block.php b/includes/Block.php index 2bae13b777..c38c929fc5 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -224,7 +224,7 @@ class Block { 'ipb_address', 'ipb_by', 'ipb_by_text', - 'ipb_by_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'ipb_by_actor' : null, + 'ipb_by_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'ipb_by_actor' : 'NULL', 'ipb_timestamp', 'ipb_auto', 'ipb_anon_only', diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index d9763c64b4..c4edcd1a9f 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -246,7 +246,7 @@ class ArchivedFile { 'fa_minor_mime', 'fa_user', 'fa_user_text', - 'fa_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'fa_actor' : null, + 'fa_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'fa_actor' : 'NULL', 'fa_timestamp', 'fa_deleted', 'fa_deleted_timestamp', /* Used by LocalFileRestoreBatch */ diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index cff1044870..90a984af4b 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -223,7 +223,7 @@ class LocalFile extends File { 'img_minor_mime', 'img_user', 'img_user_text', - 'img_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'img_actor' : null, + 'img_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'img_actor' : 'NULL', 'img_timestamp', 'img_sha1', ] + CommentStore::getStore()->getFields( 'img_description' ); diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php index 3a6b8795af..1bd40a0efb 100644 --- a/includes/filerepo/file/OldLocalFile.php +++ b/includes/filerepo/file/OldLocalFile.php @@ -136,7 +136,7 @@ class OldLocalFile extends LocalFile { 'oi_minor_mime', 'oi_user', 'oi_user_text', - 'oi_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'oi_actor' : null, + 'oi_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'oi_actor' : 'NULL', 'oi_timestamp', 'oi_deleted', 'oi_sha1', -- 2.20.1