Merge "HTMLForm: Show more options when incorrect displayFormat is set"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 26 Jul 2017 18:54:03 +0000 (18:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 26 Jul 2017 18:54:03 +0000 (18:54 +0000)
includes/htmlform/HTMLForm.php

index 61d0d89..d4351e0 100644 (file)
@@ -400,7 +400,13 @@ class HTMLForm extends ContextSource {
 
                if ( !in_array( $format, $this->availableDisplayFormats, true ) ) {
                        throw new MWException( 'Display format must be one of ' .
-                               print_r( $this->availableDisplayFormats, true ) );
+                               print_r(
+                                       array_merge(
+                                               $this->availableDisplayFormats,
+                                               $this->availableSubclassDisplayFormats
+                                       ),
+                                       true
+                               ) );
                }
 
                // Evil hack for mobile :(