Page MenuHomePhabricator

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


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

Cumbril created this task.Dec 31 2016, 12:45 PM

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

Sophivorus closed this task as Resolved.Mar 29 2017, 2:15 PM
Sophivorus claimed this task.
Cumbril added a comment.EditedMar 29 2017, 9:12 PM

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.

He7d3r added a subscriber: He7d3r.Dec 29 2017, 4:27 PM
Sophivorus closed this task as Resolved.Aug 26 2019, 1:31 PM

This has been fixed for a while.