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.
Description
Details
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
wikipedia/gadgets/ProveIt | master | +11 -2 | Re-add revision tag when previewing |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T109032 Support tags from editing form | |||
Resolved | Sophivorus | T154357 proveit-tag not applied after 'Show preview' or 'Show changes' |
Event Timeline
Change 345354 merged by Sophivorus:
[wikipedia/gadgets/ProveIt@master] Re-add revision tag when previewing
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.
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.
Thanks, I did a quick fix directly at https://commons.wikimedia.org/wiki/MediaWiki:Gadget-ProveIt.js