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

Improve usage of requested site in plugin Controllers #13526

Merged
merged 1 commit into from Oct 3, 2018

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Oct 3, 2018

No description provided.

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Oct 3, 2018
@sgiehl sgiehl added this to the 3.6.1 milestone Oct 3, 2018
$creationDateLocalTimezone = Date::factory($datetimeCreationDate, $website->getTimezone())->toString('Y-m-d');
$todayLocalTimezone = Date::factory('now', $website->getTimezone())->toString('Y-m-d');
if ($this->idSite) {
$datetimeCreationDate = $this->site->getCreationDate()->getDatetime();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice in Plugin/Controller $this->site is set to new Site(), which can throw if the site doesn't exist. So it might be possible for the site to be null while $this->idSite is set. I think we should check for $this->site in the if statement to avoid that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@diosmosis diosmosis merged commit 902bd94 into 3.x-dev Oct 3, 2018
@diosmosis diosmosis deleted the codeimprovements branch October 3, 2018 19:52
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
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 not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants