Page MenuHomePhabricator

proveit-tag not applied after 'Show preview' or 'Show changes'
Closed, ResolvedPublic

Description

If 'proveit-tag' is set in ProveIt configuration, it is only applied to edit if user presses 'Save changes' button straight after editing article with ProveIt. If user presses 'Show preview' or 'Show changes' first, the tag is not applied.
I suppose the reason it happens is because server does not send back parameter and value that was set in <input> tag in HTML with proveit.addTag method.

Event Timeline

Change 345354 merged by Sophivorus:
[wikipedia/gadgets/ProveIt@master] Re-add revision tag when previewing

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

Sophivorus claimed this task.

I think this solution works only if 'proveit-summary' is not empty string. Also, does not work if user manually changes summary added by ProveIt.

Sophivorus reopened this task as Open.EditedMar 30 2017, 5:19 PM
Sophivorus triaged this task as Low priority.

True, this is more like a temporary patch than a robust solution. I'm reopening this task until it's properly fixed. I also linked it to T109032 because solving that task would make solving this one trivial.

The patch has introduced unwanted behavior. If 'proveit-summary' is empty string and 'proveit-tag' is not empty string, then tag is not applied when user saves changes without previewing them. Which is OK. However, if he does preview changes, the tag is applied, and this happens irrespective of whether ProveIt window was opened at all.

Looking at the code lines 175–180, mw.config.get( 'wgAction' ) === 'submit' is true if you press "Preview changes", currentSummary.indexOf( proveitSummary ) returns 0 if 'proveit-summary' is empty string, so proveit.addTag() is triggered.

I removed tag in etwiki for now.

This has been fixed for a while.