jenkins-bot has submitted this change and it was merged.

Change subject: Don't try to do event logging if we don't have a stats ID
......................................................................


Don't try to do event logging if we don't have a stats ID

I found that pages like:
https://pl.wikipedia.org/w/index.php?title=Wikipedia:Strona_g%C5%82%C3%B3wna&action=edit
which load WE dynamically don't have this.

Change-Id: Ib3952f4efbf265dbb0d1e25b2059e1be934565a7
(cherry picked from commit 2b914eeddf5cf5bf48a183e6c54da08108cf8367)
---
M modules/jquery.wikiEditor.js
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  TheDJ: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/jquery.wikiEditor.js b/modules/jquery.wikiEditor.js
index ec39a73..0132cb3 100644
--- a/modules/jquery.wikiEditor.js
+++ b/modules/jquery.wikiEditor.js
@@ -502,6 +502,7 @@
        /* Preserving cursor and focus state, which will get lost due to 
wrapAll */
        var hasFocus = context.$textarea.is( ':focus' ),
                cursorPos = context.$textarea.textSelection( 
'getCaretPosition', { startAndEnd: true } ),
+               editingSessionIdInput = context.$textarea.closest( 'form' 
).find( '#editingStatsId' ),
                editingSessionId;
        // Encapsulate the textarea with some containers for layout
        context.$textarea
@@ -551,15 +552,12 @@
                context.fn.trigger( 'resize', event );
        } );
 
-       if (
-               ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 
'wgAction' ) === 'submit' ) &&
-               mw.config.get( 'wgPageContentModel' ) === 'wikitext'
-       ) {
-               editingSessionId = $( '#editform input#editingStatsId' ).val();
+       if ( editingSessionIdInput.length ) {
+               editingSessionId = editingSessionIdInput.val();
                mw.wikiEditor.logEditEvent( 'ready', {
                        editingSessionId: editingSessionId
                } );
-               $( '#editform' ).submit( function () {
+               context.$textarea.closest( 'form' ).submit( function () {
                        context.submitting = true;
                } );
                this.onUnloadFallback = window.onunload;

-- 
To view, visit https://gerrit.wikimedia.org/r/198378
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3952f4efbf265dbb0d1e25b2059e1be934565a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: wmf/1.25wmf21
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: GOIII <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to