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

Change subject: Stop trying to log to schema.Undefined
......................................................................


Stop trying to log to schema.Undefined

Bug: T135185
Change-Id: I09549b7ac82b21c5f616e4187edcc4b197868a44
---
M modules/engine/components/board/base/flow-boardandhistory-base.js
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Sbisson: Looks good to me, approved
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/engine/components/board/base/flow-boardandhistory-base.js 
b/modules/engine/components/board/base/flow-boardandhistory-base.js
index 0810a80..d906238 100644
--- a/modules/engine/components/board/base/flow-boardandhistory-base.js
+++ b/modules/engine/components/board/base/flow-boardandhistory-base.js
@@ -199,7 +199,7 @@
 
                // Only log cancel attempt if it was user-initiated, not when 
the cancel
                // was triggered by code (as part of a post-submit form destroy)
-               if ( event.which ) {
+               if ( event.which && schemaName ) {
                        flowComponent.logEvent( schemaName, { action: 
'cancel-attempt', funnelId: funnelId } );
                }
 
@@ -214,9 +214,13 @@
                // Only log if user had already entered text (= confirmation 
was requested)
                if ( changedFieldCount ) {
                        if ( confirm( 
flowComponent.constructor.static.TemplateEngine.l10n( 'flow-cancel-warning' ) ) 
) {
-                               flowComponent.logEvent( schemaName, { action: 
'cancel-success', funnelId: funnelId } );
+                               if ( schemaName ) {
+                                       flowComponent.logEvent( schemaName, { 
action: 'cancel-success', funnelId: funnelId } );
+                               }
                        } else {
-                               flowComponent.logEvent( schemaName, { action: 
'cancel-abort', funnelId: funnelId } );
+                               if ( schemaName ) {
+                                       flowComponent.logEvent( schemaName, { 
action: 'cancel-abort', funnelId: funnelId } );
+                               }
 
                                // User aborted cancel, quit this function & 
don't destruct the form!
                                return $deferred.reject().promise();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I09549b7ac82b21c5f616e4187edcc4b197868a44
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <sbis...@wikimedia.org>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Sbisson <sbis...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to