diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2021-09-07 00:31:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-07 00:31:35 +0300 |
commit | 420733d2f54571ff132e2fb873bf117e96ff12e1 (patch) | |
tree | c30a704521aaaf69511b2b1ca03f8be2a31c1662 | |
parent | 55c6ac2841231e4d85132e7a54ebf7f29aaee5af (diff) |
Fix notice Undefined index in DataCollection (#17967)
-rw-r--r-- | core/Archive/DataCollection.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/Archive/DataCollection.php b/core/Archive/DataCollection.php index 424ae9d964..fa045b056c 100644 --- a/core/Archive/DataCollection.php +++ b/core/Archive/DataCollection.php @@ -378,6 +378,17 @@ class DataCollection foreach ($this->data as $idSite => $periods) { foreach ($periods as $periodRange => $data) { + // FIXME: This hack works around a strange bug that occurs when getting + // archive IDs through ArchiveProcessing instances. When a table + // does not already exist, for some reason the archive ID for + // today (or from two days ago) will be added to the Archive + // instances list. The Archive instance will then select data + // for periods outside of the requested set. + // working around the bug here, but ideally, we need to figure + // out why incorrect idarchives are being selected. + if (empty($this->periods[$periodRange])) { + continue; + } $tableMetadata = $dataTableFactory->getTableMetadataFor($idSite, $this->periods[$periodRange]); $callable($data, $dataTableFactory, $tableMetadata); |