Make SpecialMuteModifyFormFields hook to not pass the entire special page
Bug: T257183 Change-Id: I7af57455d412dc5e93617ca0b3d6e7aac8ef500f
This commit is contained in:
parent
32491cb005
commit
6c7991b989
3 changed files with 7 additions and 6 deletions
|
|
@ -3689,10 +3689,10 @@ class HookRunner implements
|
|||
);
|
||||
}
|
||||
|
||||
public function onSpecialMuteModifyFormFields( $sp, &$fields ) {
|
||||
public function onSpecialMuteModifyFormFields( $target, $user, &$fields ) {
|
||||
return $this->container->run(
|
||||
'SpecialMuteModifyFormFields',
|
||||
[ $sp, &$fields ]
|
||||
[ $target, $user, &$fields ]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace MediaWiki\Hook;
|
||||
|
||||
use SpecialMute;
|
||||
use User;
|
||||
|
||||
/**
|
||||
* This is a hook handler interface, see docs/Hooks.md.
|
||||
|
|
@ -17,9 +17,10 @@ interface SpecialMuteModifyFormFieldsHook {
|
|||
*
|
||||
* @since 1.35
|
||||
*
|
||||
* @param SpecialMute $sp SpecialPage object, for context
|
||||
* @param User|null $target Target user
|
||||
* @param User $user Context user
|
||||
* @param array &$fields Current HTMLForm fields descriptors
|
||||
* @return bool|void True or no return value to continue or false to abort
|
||||
*/
|
||||
public function onSpecialMuteModifyFormFields( $sp, &$fields );
|
||||
public function onSpecialMuteModifyFormFields( $target, $user, &$fields );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ class SpecialMute extends FormSpecialPage {
|
|||
];
|
||||
}
|
||||
|
||||
$this->getHookRunner()->onSpecialMuteModifyFormFields( $this, $fields );
|
||||
$this->getHookRunner()->onSpecialMuteModifyFormFields( $this->getTarget(), $this->getUser(), $fields );
|
||||
|
||||
if ( count( $fields ) == 0 ) {
|
||||
throw new ErrorPageError( 'specialmute', 'specialmute-error-no-options' );
|
||||
|
|
|
|||
Loading…
Reference in a new issue