Page MenuHomePhabricator

Remove SpecialContributions::getForm::filters hook call
Closed, ResolvedPublic

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

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

@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.

@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

@Jdlrobson, it looks like we're still blocked on https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/281100/ here. Is that right? Do you think that patchset will proceed any time soon?

@Halfak Yes, it will proceed. The patch itself is blocked on another patch, that cares about an accessibility feature needed coming with that patch, which needs a bit more time. Both is on my list, and got deprioritized by other requests, but will look into it next couple of weeks.

Thank you, @Volker_E! No hurry. I just wanted to make sure I understood the blocker so thanks for your help :)

Change 281100 merged by jenkins-bot:
[mediawiki/core@master] Make Special:Contributions use OOUI

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

Change 499791 merged by jenkins-bot:
[mediawiki/extensions/ORES@master] Make onSpecialContributionsGetFormFilters follow the OOUI mode

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

@Volker_E, I see we have a patch merged. Is this done?