New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix addTracker does not return the tracker instance #12203
Conversation
TBD: Need to rebuild js, need to maybe add a test if possible.
js/piwik.js
Outdated
@@ -7281,9 +7281,9 @@ if (typeof window.Piwik !== 'object') { | |||
*/ | |||
addTracker: function (piwikUrl, siteId) { | |||
if (!asyncTrackers.length) { | |||
createFirstTracker(piwikUrl, siteId); | |||
return createFirstTracker(piwikUrl, siteId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc block already mentioned we return tracker instance, but we did not.
js/piwik.js
Outdated
} else { | ||
asyncTrackers[0].addTracker(piwikUrl, siteId); | ||
return asyncTrackers[0].addTracker(piwikUrl, siteId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSLint fails here. Guess it needs to be
var tracker;
if (!asyncTrackers.length) {
tracker = createFirstTracker(piwikUrl, siteId);
} else {
tracker = asyncTrackers[0].addTracker(piwikUrl, siteId);
}
return tracker;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx @sgiehl fixed it, JSLint tests pass now
TBD: