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

Ensure to use correct date while archiving #15728

Merged
merged 2 commits into from Mar 25, 2020
Merged

Ensure to use correct date while archiving #15728

merged 2 commits into from Mar 25, 2020

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Mar 24, 2020

refs #15727

@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 Mar 24, 2020
@sgiehl sgiehl added this to the 3.13.5 milestone Mar 24, 2020
@sgiehl sgiehl requested a review from diosmosis March 24, 2020 13:55
@@ -991,7 +990,7 @@ public function isThereAValidArchiveForPeriod($idSite, $period, $date, $segment
if ($isTodayIncluded
&& !$isLast
) {
return [false, null];
return [false, $date];
Copy link
Member Author

Choose a reason for hiding this comment

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

we need to return the date here, as otherwise the date used for archiving will be null here:

list($isThereArchive, $newDate) = $this->isThereAValidArchiveForPeriod($idSite, 'day', $date, $segment = '');

Copy link
Member

Choose a reason for hiding this comment

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

@sgiehl did you notice this by fixing some test or was something not working? I assume there was some core:archive used with specifically today?

Copy link
Member Author

Choose a reason for hiding this comment

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

see the linked issue #15727

@sgiehl sgiehl linked an issue Mar 24, 2020 that may be closed by this pull request
@@ -978,10 +977,10 @@ protected function processArchiveDays($idSite, $lastTimestampWebsiteProcessedDay
public function isThereAValidArchiveForPeriod($idSite, $period, $date, $segment = '')
{
if (Range::isMultiplePeriod($date, $period)) {
$rangePeriod = Factory::build($period, $date, Site::getTimezoneFor($idSite));
$rangePeriod = PeriodFactory::build($period, $date, Site::getTimezoneFor($idSite));
Copy link
Member

Choose a reason for hiding this comment

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

@sgiehl is that change needed or is it actually causing an issue? Just asking out of curiosity.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really needed. But it's a bit messy to import the same class twice with different aliases...

@diosmosis
Copy link
Member

LGTM, there should be some tests covering this behavior that will need to be udpated.

@sgiehl sgiehl merged commit 96c3e51 into 3.x-dev Mar 25, 2020
@sgiehl sgiehl deleted the fixarchiving branch March 25, 2020 08:31
@diosmosis
Copy link
Member

@sgiehl this fixes #15727 correct?

@sgiehl
Copy link
Member Author

sgiehl commented Mar 26, 2020 via email

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.

Archiving specific date via console won't take date as argument.
3 participants