Page MenuHomePhabricator

FlaggedRev's over-ride of the submit button's label via the EditPageBeforeEditButtons PHP hook doesn't work for any other code (mobile apps, mobile Web, VisualEditor, 2017 Wikitext Editor, …)
Open, LowPublic8 Estimated Story Points


FlaggedRevs switches out publishpage/publishchanges (or save… equivalents) with revreview-submitedit. It does this through the EditPageBeforeEditButtons hook, with the changeSaveButton method in FlaggablePageView that has a lot of fragile, ugly hackery to just replace two configured message keys.

Can we "just" sub-class EditPage, replace getSubmitButtonLabel (to do this more neatly), and provide it out as an API for client editors somehow?

Event Timeline

@matmarex / @Legoktm – either of you have ideas? I'm not sure what the best way forward would be.

Change 387348 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/FlaggedRevs@master] FlaggablePageView::changeSaveButton: Use OOUI methods to over-write

Subclassing EditPage is probably a bad idea in this case, as it will break everything else that needs to override EditPage (c.f. TwoColConflict). We should probably provide a hook to override getSubmitButtonLabel().

Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

Change 387348 merged by jenkins-bot:
[mediawiki/extensions/FlaggedRevs@master] FlaggablePageView::changeSaveButton: Use OOUI methods to over-write

Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF changed the point value for this task from 1 to 8.

OK, so now everything is as before for users, but the code is a bit better. It's still going through the EditPageBeforeEditButtons hook, so still inaccessible through the API. Ideas?

Deskana lowered the priority of this task from Medium to Low.Aug 30 2018, 10:02 AM
Deskana moved this task from TR0: Interrupt to Freezer on the VisualEditor board.