HTMLForm: Show more options when incorrect displayFormat is set
authorPrateek Saxena <prtksxna@gmail.com>
Mon, 24 Jul 2017 18:37:14 +0000 (00:07 +0530)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 26 Jul 2017 18:45:36 +0000 (18:45 +0000)
Change-Id: I47a4684f01f5e30629e819403d7445479c4607da

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 :(