Fix EditAttemptStep events logged with revision_id=0

When opening the old wikitext editor, 'wgRevisionId' is always set to
0, and remains that way even if we switch to visual editor.

Elsewhere in the code, we handle this case by reading the revision ID
from the old wikitext edit form, so do that here as well. (This still
works after switching to visual editor.)

Bug: T230133
Change-Id: I9d3a23beb6b1393633b94ac3c9c6c667d7560308
This commit is contained in:
Bartosz Dziewoński 2020-02-11 19:36:33 +01:00
parent 5b2ba08c44
commit 2f5856bd2e

View file

@ -150,7 +150,8 @@
page_id: mw.config.get( 'wgArticleId' ),
page_title: mw.config.get( 'wgPageName' ),
page_ns: mw.config.get( 'wgNamespaceNumber' ),
revision_id: mw.config.get( 'wgRevisionId' ),
// eslint-disable-next-line no-jquery/no-global-selector
revision_id: mw.config.get( 'wgRevisionId' ) || $( 'input[name=parentRevId]' ).val(),
editing_session_id: editingSessionId,
page_token: mw.user.getPageviewToken(),
session_token: mw.user.sessionId(),