CapsuleMultiselectWidget. The following methods may no longer be used:
* setItemsFromData: Use setValue instead
* getItemsData: Use getItems instead and get the data property
-* The hook 'LogEventsListGetExtraInputs' now needs a form descriptor array
- and not plain HTML.
* LanguageCode::bcp47() now always returns a valid BCP 47 code. This means
that some MediaWiki-specific language codes, such as `simple`, are mapped
into valid BCP 47 codes (eg `en-simple`).
* (T100681) Use of the Parsoid v1 API with the VirtualRESTService, deprecated in
MediaWiki 1.26, is now hard-deprecated. All known clients were converted to
the Parsoid v3 API in May 2015.
+* $input is deprecated in hook 'LogEventsListGetExtraInputs'. Use
+ $formDescriptor instead.
=== Other changes in 1.32 ===
* (T198811) The following tables have had their UNIQUE indexes turned into
Special:Log for a specific log type
$type: String of log type being displayed
$logEventsList: LogEventsList object for context and access to the WebRequest
+&$input: string HTML of an input element (deprecated, use $formDescriptor instead)
&$formDescriptor: array HTMLForm's form descriptor
'LogEventsListShowLogExtract': Called before the string is added to OutputPage.
$formDescriptor['page'] = $this->getTitleInputDesc( $title );
// Add extra inputs if any
+ // This could either be a form descriptor array or a string with raw HTML.
+ // We need it to work in both cases and show a deprecation warning if it
+ // is a string. See T199495.
$extraInputsDescriptor = $this->getExtraInputsDesc( $types );
- if ( !empty( $extraInputsDescriptor ) ) {
+ if (
+ is_array( $extraInputsDescriptor ) &&
+ !empty( $extraInputsDescriptor )
+ ) {
$formDescriptor[ 'extra' ] = $extraInputsDescriptor;
+ } elseif ( is_string( $extraInputsDescriptor ) ) {
+ // We'll add this to the footer of the form later
+ $extraInputsString = $extraInputsDescriptor;
+ wfDeprecated( 'Using $input in LogEventsListGetExtraInputs hook', '1.32' );
}
// Title pattern, if allowed
->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
->setWrapperLegendMsg( 'log' );
+ // TODO This will should be removed at some point. See T199495.
+ if ( isset( $extraInputsString ) ) {
+ $htmlForm->addFooterText( Html::rawElement(
+ 'div',
+ null,
+ $extraInputsString
+ ) );
+ }
+
$htmlForm->prepareForm()->displayForm( false );
}
/**
* @param array $types
- * @return array Form descriptor
+ * @return array|string Form descriptor or string with HTML
*/
private function getExtraInputsDesc( $types ) {
if ( count( $types ) == 1 ) {
];
} else {
// Allow extensions to add their own extra inputs
+ // This could be an array or string. See T199495.
+ $input = ''; // Deprecated
$formDescriptor = [];
- Hooks::run( 'LogEventsListGetExtraInputs', [ $types[0], $this, &$formDescriptor ] );
- return $formDescriptor;
+ Hooks::run( 'LogEventsListGetExtraInputs', [ $types[0], $this, &$input, &$formDescriptor ] );
+
+ return empty( $formDescriptor ) ? $input : $formDescriptor;
}
}