From c9b599ababfa270fa1c8dcf25600c1c0448b03e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 2 Oct 2018 23:22:00 +0200 Subject: [PATCH] HTMLInfoField: Undo breaking change, deprecate instead, add release notes Follow-up to e6eb87ae2028d9d3f9317d75cced42511ed97b9e. Bug: T203202 Bug: T205956 Change-Id: I2d19d376d218c59e4ea36e8635e883afac2adea6 --- RELEASE-NOTES-1.32 | 5 +++++ includes/htmlform/fields/HTMLInfoField.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index affa83db40..2375b9014c 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -501,6 +501,11 @@ because of Phabricator reports. RevisionArchiveRecord, RevisionFactory, RevisionLookup, RevisionRecord, RevisionSlots, RevisionStore, RevisionStoreRecord, SlotRecord, and SuppressedDataException. +* When using OOUI HTMLForm containing an 'info' field which uses the 'rawrow' + option, it is now deprecated to give its contents (the 'default' option) + as a string. They should be given as a OOUI\FieldLayout object instead. + Notably, this affects fields defined in the 'GetPreferences' hook, because + Special:Preferences uses an OOUI form now. (If possible, don't use 'rawrow'.) === Other changes in 1.32 === * (T198811) The following tables have had their UNIQUE indexes turned into diff --git a/includes/htmlform/fields/HTMLInfoField.php b/includes/htmlform/fields/HTMLInfoField.php index a98f11289d..c0dbf500d2 100644 --- a/includes/htmlform/fields/HTMLInfoField.php +++ b/includes/htmlform/fields/HTMLInfoField.php @@ -83,7 +83,8 @@ class HTMLInfoField extends HTMLFormField { public function getOOUI( $value ) { if ( !empty( $this->mParams['rawrow'] ) ) { if ( !( $value instanceof OOUI\FieldLayout ) ) { - throw new Exception( "'default' must be a FieldLayout or subclass when using 'rawrow'" ); + wfDeprecated( "'default' parameter as a string when using 'rawrow' " . + "(must be a FieldLayout or subclass)", '1.32' ); } return $value; } -- 2.20.1