Page MenuHomePhabricator

"Edit with migration tool" sidebar link should only be shown if the user can edit the page
Open, Needs TriagePublic

Description

For eg. Wikidata items, it doesn't make sense to show this link because items don't have wikitext. Also it doesn't make sense to show the link if the user cannot edit the page.

This can be checked using [[ https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/Title.php$2165 | Title::quickUserCan ]] and another call.

The relevant method is [[ https://phabricator.wikimedia.org/diffusion/EPMI/browse/master/includes/Hooks.php$25 | Hooks::onBaseTemplateToolbox ]].

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 30 2018, 2:09 PM

Right. Except for the quickUserCan part. So that patch can be amended or another patch can be created on top of that one.

That is a good point. Actually, I could adjust the patch not to include the change to Hooks.php, to allow the proposed patch to handle that as well. It would make the existing patch a little more focussed too. Does that sound good?

Does that sound good?

Yes, feel free to claim this.

A note that popped up during the review of 358425: ParserMigration aims to migrate Wiki text content formats, so not just the Wiki text content model. Any check should ensure that it does check against the content format, as extensions such as ProofreadPage use the same content format, but a different content model, and benefit from this extension.