dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
HTMLForm: Show more options when incorrect displayFormat is set
[lhc/web/wiklou.git]
/
includes
/
htmlform
/
HTMLForm.php
diff --git
a/includes/htmlform/HTMLForm.php
b/includes/htmlform/HTMLForm.php
index
e627cfd
..
d4351e0
100644
(file)
--- a/
includes/htmlform/HTMLForm.php
+++ b/
includes/htmlform/HTMLForm.php
@@
-165,6
+165,7
@@
class HTMLForm extends ContextSource {
'url' => 'HTMLTextField',
'title' => 'HTMLTitleTextField',
'user' => 'HTMLUserTextField',
'url' => 'HTMLTextField',
'title' => 'HTMLTitleTextField',
'user' => 'HTMLUserTextField',
+ 'usersmultiselect' => 'HTMLUsersMultiselectField',
];
public $mFieldData;
];
public $mFieldData;
@@
-284,7
+285,7
@@
class HTMLForm extends ContextSource {
return ObjectFactory::constructClassInstance( OOUIHTMLForm::class, $arguments );
default:
/** @var HTMLForm $form */
return ObjectFactory::constructClassInstance( OOUIHTMLForm::class, $arguments );
default:
/** @var HTMLForm $form */
- $form = ObjectFactory::constructClassInstance(
HTMLForm
::class, $arguments );
+ $form = ObjectFactory::constructClassInstance(
self
::class, $arguments );
$form->setDisplayFormat( $displayFormat );
return $form;
}
$form->setDisplayFormat( $displayFormat );
return $form;
}
@@
-399,7
+400,13
@@
class HTMLForm extends ContextSource {
if ( !in_array( $format, $this->availableDisplayFormats, true ) ) {
throw new MWException( 'Display format must be one of ' .
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 :(
}
// Evil hack for mobile :(
@@
-1258,7
+1265,7
@@
class HTMLForm extends ContextSource {
*
* @param string|array|Status $elements The set of errors/warnings to process.
* @param string $elementsType Should warnings or errors be returned. This is meant
*
* @param string|array|Status $elements The set of errors/warnings to process.
* @param string $elementsType Should warnings or errors be returned. This is meant
- *
for Status objects, all other valid types are always considered as errors.
+ * for Status objects, all other valid types are always considered as errors.
* @return string
*/
public function getErrorsOrWarnings( $elements, $elementsType ) {
* @return string
*/
public function getErrorsOrWarnings( $elements, $elementsType ) {