fix projects filters

This commit is contained in:
fogelito
2026-01-13 11:20:06 +02:00
parent 1ae2d09e4b
commit aab780476e
3 changed files with 6 additions and 9 deletions
@@ -170,9 +170,7 @@ class XList extends Action
$selectedAttributes = [];
foreach ($selectQueries as $query) {
foreach ($query->getValues() as $value) {
$selectedAttributes[] = $value;
}
$selectedAttributes[] = $query->getAttribute();
}
if (\in_array('*', $selectedAttributes)) {
@@ -20,12 +20,11 @@ class ListSelection extends Filter
$selections = [];
foreach ($this->selectQueries as $query) {
foreach ($query->getValues() as $value) {
if ($value === '*') {
return $content;
}
$selections[$value] = true;
if ($query->getAttribute() === '*') {
return $content;
}
$selections[$query->getAttribute()] = true;
}
return $this->handleList($content, $this->itemsKey, function (array $item) use ($selections) {
@@ -481,7 +481,7 @@ class ProjectsConsoleClientTest extends Scope
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']);
$this->assertGreaterThan(0, count($response['body']['projects']));
var_dump($response);
$project = $response['body']['projects'][0];
$this->assertArrayHasKey('$id', $project);
$this->assertArrayHasKey('name', $project);