Page MenuHomePhabricator

wgRevisionId is 0 for edit page
Open, LowPublic

Description

The JavaScript variable wgRevisionId is 0 when editing with the wikitext editor.

It seems that logically, it should be the revision used as the basis of the edit (the latest, or an oldid if that was used in the URL).

wgCurRevisionId (which is always the latest) is set.


See Also:
T53594: Add wgRevisionId for revision of displayed page or diff

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:52 AM
bzimport set Reference to bz60548.
bzimport added a subscriber: Unknown Object (MLST).

In fact, looking at the code, it's only set when action=view (by calling $outputPage->setRevisionId() in Article.php).

Change 205194 had a related patch set uploaded (by Krinkle):
OutputPage: Set wgRevisionId on edit pages too

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

Krinkle set Security to None.

Change 205194 abandoned by Krinkle:
OutputPage: Set wgRevisionId in mw.config for edit pages too

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

Krinkle lowered the priority of this task from Medium to Low.Jun 3 2015, 2:02 AM

Maybe it should be removed from edit pages (and other cases where it would be 0). But per comments on https://gerrit.wikimedia.org/r/205194 and elsewhere, there may not be a sensible value since there can be undo requests, and cases where user arrives on the page from another context (e.g. change from VE to wikitext). So the textarea can't be used for any purpose. And unless there is a preview, the page isn't related to the revision either.

Pending actionable use cases, declining the request to add a revision id for edit pages. Keeping this task open as the 0 is wrong and should be removed.

Krinkle removed subscribers: gerritbot, Unknown Object (MLST).