Skip to content

Commit

Permalink
Fix date time range filter data extraction (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
1ed authored Jul 4, 2024
1 parent 880f58a commit 01b7864
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Event/Subscriber/AbstractDoctrineSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function filterDateTimeRange(GetFilterConditionEvent $event)
$values = $event->getValues();
$value = $values['value'];

if (isset($value['left_datetime'][0]) || $value['right_datetime'][0]) {
if (isset($value['left_datetime'][0]) || isset($value['right_datetime'][0])) {
$event->setCondition($expr->datetimeInRange($event->getField(), $value['left_datetime'][0], $value['right_datetime'][0]));
}
}
Expand Down
2 changes: 1 addition & 1 deletion Filter/DataExtractor/FormDataExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function addMethod(DataExtractionMethodInterface $method)
public function extractData(FormInterface $form, $methodName)
{
if (!isset($this->methods[$methodName])) {
throw new \RuntimeException(sprintf('Unknown extration method maned "%s".', $methodName));
throw new \RuntimeException(sprintf('Unknown extraction method maned "%s".', $methodName));
}

return $this->methods[$methodName]->extract($form);
Expand Down
3 changes: 0 additions & 3 deletions Filter/DataExtractor/Method/ValueKeysExtractionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ public function extract(FormInterface $form)
$values['value'][$key][$k] = $v;
}
}
} else {
dump($keys, $data);
throw new \InvalidArgumentException(sprintf('No value found for key "%s" in form data.', $key));
}
}

Expand Down

0 comments on commit 01b7864

Please sign in to comment.