diff options
author | Ben Burgess <88810029+bx80@users.noreply.github.com> | 2022-08-08 18:16:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-08 18:16:17 +0300 |
commit | 1ef548f5a28d08f741697fd012a3c988b3e5c8a0 (patch) | |
tree | 9a897c569f5a53c35336466875a4717bd666cf1e /core | |
parent | a8338460fd9883e5458db31b24ca399fef99ba71 (diff) |
Fix for current year not processed for new custom reports (#19569)
* Ignore repair year invalidation when processing a week that spans two years
* Added integration test
* Fixed test
Diffstat (limited to 'core')
-rw-r--r-- | core/CronArchive.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index de55cddcc0..7108ef9e04 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -1054,13 +1054,20 @@ class CronArchive continue; } - // archive is for week that is over two months, we don't need to care about the month + // archive is for a week that is over two months, we don't need to care about the month if ($label == 'month' && Date::factory($archiveToProcess['date1'])->toString('m') != Date::factory($archiveToProcess['date2'])->toString('m') ) { continue; } + // archive is for a week that is over two years, we don't need to care about the year + if ($label == 'year' + && Date::factory($archiveToProcess['date1'])->toString('y') != Date::factory($archiveToProcess['date2'])->toString('y') + ) { + continue; + } + $period = Period\Factory::build($label, $archiveToProcess['date1']); $invalidationToInsert = [ |