Skip to content
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

Merged
merged 3 commits into from Oct 19, 2017
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Oct 17, 2017

TBD:

  • Need to rebuild js,
  • need to maybe add a test if possible.

TBD: Need to rebuild js, need to maybe add a test if possible.
@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Oct 17, 2017
@tsteur tsteur added this to the 3.2.1 milestone Oct 17, 2017
@tsteur tsteur added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Oct 17, 2017
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);
Copy link
Member Author

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);
}
Copy link
Member

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;

Copy link
Member Author

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

@tsteur tsteur merged commit 11caafb into 3.x-dev Oct 19, 2017
@tsteur tsteur deleted the addtrackerinstance branch October 19, 2017 20:11
@matomo-org matomo-org deleted a comment from MatomoForumBot Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants