From 287a2aafe9c6e3d44f3f32a7ca1c2694df71d774 Mon Sep 17 00:00:00 2001 From: "T. Bayer" Date: Wed, 12 Sep 2018 04:26:21 -0700 Subject: [PATCH] Exclude redlink clicks from modalEditClicked event This event is meant to track attempts to edit the page we are on, but also happened to catch clicks on "see talk page" links, in case that talk page doesn't exist yet. Bug: T204073 Change-Id: I1a471f81cc9390fc9e8665a7a336cf2dd7a063ab --- resources/skins.minerva.scripts/PageIssuesOverlay.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/skins.minerva.scripts/PageIssuesOverlay.js b/resources/skins.minerva.scripts/PageIssuesOverlay.js index 81c6142a2..09de06439 100644 --- a/resources/skins.minerva.scripts/PageIssuesOverlay.js +++ b/resources/skins.minerva.scripts/PageIssuesOverlay.js @@ -60,7 +60,9 @@ */ events: util.extend( {}, Overlay.prototype.events, { 'click a:not(.external):not([href*=edit])': 'onInternalClick', - 'click a[href*="edit"]': 'onEditClick' + // Only register attempts to edit an existing page (should be the one we are on), + // not internal clicks on redlinks to nonexistent pages: + 'click a[href*="edit"]:not([href*=redlink])': 'onEditClick' } ), /** @@ -123,6 +125,7 @@ * Event that is triggered when an edit link inside the overlay is clicked. This is * primarily used for instrumenting page issues (see * https://meta.wikimedia.org/wiki/Schema:PageIssues). + * The event will not be triggered in the case of red links. * @param {JQuery.Event} ev * @memberof PageIssuesOverlay * @instance