Skip to content

Commit 1fb59bb

Browse files
committed
Merge branch 'hotfix/1.1.1'
2 parents c7c48b5 + 251b626 commit 1fb59bb

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ See [keep a changelog] for information about writing changes to this log.
88

99
## [Unreleased]
1010

11+
## [1.1.1] - 2025-03-28
12+
13+
- Fix date range filter error for updated field
14+
1115
## [1.1.0] - 2025-03-20
1216

1317
### Added

src/Api/Dto/DailyOccurrence.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@
7070
#[ApiFilter(
7171
DateRangeFilter::class,
7272
properties: [
73-
'start' => 'start',
74-
'end' => 'end',
75-
'updated' => 'start',
73+
'start' => 'gte',
74+
'end' => 'lte',
75+
'updated' => 'gte',
7676
],
7777
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
7878
arguments: [
7979
'config' => [
80-
'start' => [
80+
'gte' => [
8181
'limit' => DateLimit::gte,
8282
'throwOnInvalid' => true,
8383
],
84-
'end' => [
84+
'lte' => [
8585
'limit' => DateLimit::lte,
8686
'throwOnInvalid' => true,
8787
],

src/Api/Dto/Event.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@
7070
#[ApiFilter(
7171
DateRangeFilter::class,
7272
properties: [
73-
'occurrences.start' => 'start',
74-
'occurrences.end' => 'end',
75-
'updated' => 'start',
73+
'occurrences.start' => 'gte',
74+
'occurrences.end' => 'lte',
75+
'updated' => 'gte',
7676
],
7777
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
7878
arguments: [
7979
'config' => [
80-
'start' => [
80+
'gte' => [
8181
'limit' => DateLimit::gte,
8282
'throwOnInvalid' => true,
8383
],
84-
'end' => [
84+
'lte' => [
8585
'limit' => DateLimit::lte,
8686
'throwOnInvalid' => true,
8787
],

src/Api/Dto/Occurrence.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@
6666
#[ApiFilter(
6767
DateRangeFilter::class,
6868
properties: [
69-
'start' => 'start',
70-
'end' => 'end',
71-
'updated' => 'start',
69+
'start' => 'gte',
70+
'end' => 'lte',
71+
'updated' => 'gte',
7272
],
7373
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
7474
arguments: [
7575
'config' => [
76-
'start' => [
76+
'gte' => [
7777
'limit' => DateLimit::gte,
7878
'throwOnInvalid' => true,
7979
],
80-
'end' => [
80+
'lte' => [
8181
'limit' => DateLimit::lte,
8282
'throwOnInvalid' => true,
8383
],

src/Api/Filter/ElasticSearch/DateRangeFilter.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ public function getDescription(string $resourceClass): array
8282

8383
private function getElasticSearchQueryRanges($property, $filter): array
8484
{
85+
if (null === $this->properties) {
86+
throw new \InvalidArgumentException('The property must be defined in the filter.');
87+
}
8588
if (!\is_array($filter)) {
86-
$operator = $this->config[$property]->limit;
89+
$fallbackOperator = $this->properties[$property];
90+
$operator = $this->config[$fallbackOperator]->limit;
8791
$value = $filter;
8892
} else {
8993
$operator = DateLimit::{array_key_first($filter)};

0 commit comments

Comments
 (0)