Alex Monk has uploaded a new change for review.

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

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
---
M modules/jquery.wikiEditor.js
1 file changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor 
refs/changes/34/198134/1

diff --git a/modules/jquery.wikiEditor.js b/modules/jquery.wikiEditor.js
index 3df0c22..e1a865a 100644
--- a/modules/jquery.wikiEditor.js
+++ b/modules/jquery.wikiEditor.js
@@ -551,15 +551,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 ( context.$textarea.closest( 'form' ).find( '#editingStatsId' ) ) {
+               editingSessionId = context.$textarea.closest( 'form' ).find( 
'#editingStatsId' ).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/198134
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3952f4efbf265dbb0d1e25b2059e1be934565a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>

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

Reply via email to