mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Improve how we render help messages in preferences
* The 'help' parameter expects a string, not a Message object. It seemed to be working, but caused fatals when switching the preferences form to the OOUI implementation (T117781). * Use 'help-message' instead, which also avoids using the global request context for Message objects. Bug: T117781 Change-Id: I5b2e44df35a2696da0e7ba8394eccf41914f6dda
This commit is contained in:
parent
dfad838fa7
commit
2b637e42ef
|
@ -76,7 +76,7 @@ class PopupsHooks {
|
|||
$option = [
|
||||
'type' => 'radio',
|
||||
'label-message' => 'popups-prefs-optin-title',
|
||||
'help' => wfMessage( 'popups-prefs-conflicting-gadgets-info' ),
|
||||
'help-message' => 'popups-prefs-conflicting-gadgets-info',
|
||||
'options' => [
|
||||
wfMessage( 'popups-prefs-optin-enabled-label' )->text()
|
||||
=> PopupsContext::PREVIEWS_ENABLED,
|
||||
|
@ -87,8 +87,8 @@ class PopupsHooks {
|
|||
];
|
||||
if ( $context->conflictsWithNavPopupsGadget( $user ) ) {
|
||||
$option[ 'disabled' ] = true;
|
||||
$option[ 'help' ] = wfMessage( 'popups-prefs-disable-nav-gadgets-info',
|
||||
'Special:Preferences#mw-prefsection-gadgets' );
|
||||
$option[ 'help-message' ] = [ 'popups-prefs-disable-nav-gadgets-info',
|
||||
'Special:Preferences#mw-prefsection-gadgets' ];
|
||||
}
|
||||
|
||||
$skinPosition = array_search( 'skin', array_keys( $prefs ) );
|
||||
|
|
|
@ -105,7 +105,7 @@ class PopupsHooksTest extends MediaWikiTestCase {
|
|||
$prefs[ PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME ] );
|
||||
$this->assertEquals( true,
|
||||
$prefs[ PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME]['disabled'] );
|
||||
$this->assertNotEmpty( $prefs[ PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME]['help'] );
|
||||
$this->assertNotEmpty( $prefs[ PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME]['help-message'] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue