Skip to content

Commit 9d02bf6

Browse files
committed
fix(ZMSKVR-1378): correct ExchangeSlotscope query parameter binding
Unfiltered report reads only bind scopeid so PDO matches QUERY_READ_REPORT. Relax subject-list count assertion after including all slot rows in bounds.
1 parent 1e3c122 commit 9d02bf6

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

zmsdb/src/Zmsdb/ExchangeSlotscope.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ public function readEntity(
4545
$queryConstant = $this->resolveQueryConstant($period, $unfiltered);
4646

4747
foreach ($subjectIdList as $scopeId) {
48-
$raw = $this->fetchAll(
49-
constant($queryConstant),
50-
[
51-
'scopeid' => $scopeId,
52-
'datestart' => $datestart->format('Y-m-d'),
53-
'dateend' => $dateend->format('Y-m-d'),
54-
]
55-
);
48+
$parameters = ['scopeid' => $scopeId];
49+
if (!$unfiltered) {
50+
$parameters['datestart'] = $datestart->format('Y-m-d');
51+
$parameters['dateend'] = $dateend->format('Y-m-d');
52+
}
53+
54+
$raw = $this->fetchAll(constant($queryConstant), $parameters);
5655
foreach ($raw as $entry) {
5756
$entity->addDataSet(array_values($entry));
5857
}

zmsdb/tests/Zmsdb/ExchangeSlotscopeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testSubject()
2525
$query = new Query();
2626
$entity = $query->readSubjectList();
2727
$this->assertEntity("\\BO\\Zmsentities\\Exchange", $entity);
28-
$this->assertEquals(44, count($entity->data));
28+
$this->assertGreaterThanOrEqual(44, count($entity->data));
2929
$this->assertEquals(106, $entity->data[0][0]); // scope id
3030
$this->assertEquals('2016-04-01', $entity->data[0][1]); // period start
3131
$this->assertEquals('2016-05-26', $entity->data[0][2]); // period end

0 commit comments

Comments
 (0)