Page MenuHomePhabricator

Remove SpecialContributions::getForm::filters hook call
Open, Needs TriagePublic

Description

With T117736 we want to remove SpecialContributions::getForm::filters hook.
ORES seems to be the only consumer currently:
https://codesearch.wmflabs.org/search/?q=%3A%3AgetForm%3A%3Afilters&i=nope&files=&repos=

Event Timeline

Volker_E created this task.Mar 25 2019, 9:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 281100 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] Make Special:Contributions use OOUI

https://gerrit.wikimedia.org/r/281100

Jdlrobson moved this task from Inbox to Blocked on the User-Jdlrobson board.

@Ladsgroup what's the deprecation policy for changes like this that can't be made backwards compatible? Do I just need to note in RELEASE notes it's been removed?

I think if you need a hook, we can repurpose the hook to be more OOUI compatible.

@Jdlrobson I looked at the hook and its functionalities, we use this to filter out good edits on Special:Contributions. For example this one wikidata. Dropping it would cause disruptions to users. I think the hook should repurposed. If you do it in your patch in core, I'll handle the ores extension part.

Jdlrobson added a comment.EditedMar 27 2019, 7:55 PM

@Ladsgroup I think we can repurpose this in such a way that you have to provide HTML form entries.
Does that work for you?

Pseudo code:

Hooks::run(
			'SpecialContributions::getForm::filters',
			[ $this, &$filters ]
);

function onGetFormFilters( $sp, &$filters ) {
            &filters[] = [
			'type' => 'check',
			'cssclass' => 'mw-hide-minor-edits',
			'id' => 'mw-show-new-only',
			'label' => $this->msg( 'sp-contributions-hideminor' )->text(),
			'name' => 'hideMinor',
		];
      return true;

Ive managed to make the hook backwards compatible but while left unfixed it will throw a deprecation notice and style checkboxes inconsistently with the rest of the form.

Please let me know on https://gerrit.wikimedia.org/r/281100 if you feel this is acceptable! Thanks in advance!

@Ladsgroup I think we can repurpose this in such a way that you have to provide HTML form entries.
Does that work for you?
Pseudo code:

Hooks::run(
			'SpecialContributions::getForm::filters',
			[ $this, &$filters ]
);
function onGetFormFilters( $sp, &$filters ) {
            &filters[] = [
			'type' => 'check',
			'cssclass' => 'mw-hide-minor-edits',
			'id' => 'mw-show-new-only',
			'label' => $this->msg( 'sp-contributions-hideminor' )->text(),
			'name' => 'hideMinor',
		];
      return true;

that would work for me.

Change 499791 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/ORES@master] Make onSpecialContributionsGetFormFilters follow the OOUI mode

https://gerrit.wikimedia.org/r/499791