Skip to content

Commit 0fa141d

Browse files
committed
Don't suggest DateTime objects
1 parent 1fb40f9 commit 0fa141d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/X509/Web/Control/SearchBar/ObjectSuggestions.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Icinga\Module\X509\Web\Control\SearchBar;
44

5+
use DateTime;
56
use Exception;
67
use Icinga\Module\X509\Common\Database;
78
use ipl\Orm\Exception\InvalidColumnException;
@@ -137,7 +138,7 @@ protected function fetchValueSuggestions($column, $searchTerm, Filter\Chain $sea
137138
$value = $value ? 'y' : 'n';
138139
}
139140

140-
yield $value;
141+
yield $value instanceof DateTime ? $value->getTimestamp() : $value;
141142
}
142143
} catch (InvalidColumnException $e) {
143144
throw new SearchException(sprintf(t('"%s" is not a valid column'), $e->getColumn()));

0 commit comments

Comments
 (0)