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

In JS tracker generator make sure to reuse same class when creating new file #14660

Merged
merged 1 commit into from Jul 17, 2019

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jul 16, 2019

Background:
Someone might use DI to set a custom file type like this:

  'Piwik\Plugins\CustomPiwikJs\TrackerUpdater' => DI\decorate(function ($previous) {
 
        $to = new \Piwik\Plugins\MyPlugin\CdnFile('mypath/piwik.js');

        $previous->setToFile($to);

        return $previous;
    }),

The tracker updater would then eg update the file content on the CDN instead of locally. However, because we have a piwik.js and a matomo.js that needs to be updated, the matomo.js would have still been updated on the local filesystem because it was using new File() hard coded where it should have created basically new CdnFile().

We need this patch on the cloud fyi.

@tsteur tsteur added the Needs Review PRs that need a code review label Jul 16, 2019
@tsteur tsteur added this to the 3.11.0 milestone Jul 16, 2019
@tsteur
Copy link
Member Author

tsteur commented Jul 17, 2019

Merging this one as tests pass and we have it in use on production and works there.

@tsteur tsteur merged commit cf6e966 into 3.x-dev Jul 17, 2019
@tsteur tsteur deleted the custompiwikjsfile branch July 17, 2019 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant