HTMLInfoField: Undo breaking change, deprecate instead, add release notes
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 2 Oct 2018 21:22:00 +0000 (23:22 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 11 Oct 2018 00:06:48 +0000 (02:06 +0200)
Follow-up to e6eb87ae2028d9d3f9317d75cced42511ed97b9e.

Bug: T203202
Bug: T205956
Change-Id: I2d19d376d218c59e4ea36e8635e883afac2adea6

RELEASE-NOTES-1.32
includes/htmlform/fields/HTMLInfoField.php

index affa83d..2375b90 100644 (file)
@@ -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
index a98f112..c0dbf50 100644 (file)
@@ -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;
                }