Fix ability to update an existing poll (6122)

This commit is contained in:
pitchum 2023-03-26 11:15:46 +02:00 committed by root
parent cd9b00d0e9
commit 6d8c60c88b

View File

@ -35,15 +35,13 @@ class AdminPollService {
{ {
global $config; global $config;
$end_date = strtotime($poll->end_date); if ($poll->end_date < $poll->creation_date) {
$poll->end_date = $poll->creation_date;
} elseif ($poll->end_date > $this->pollService->maxExpiryDate()) {
$poll->end_date = $this->pollService->maxExpiryDate();
}
if ($end_date < strtotime($poll->creation_date)) { return $this->pollRepository->update($poll);
$poll->end_date = $poll->creation_date;
} elseif ($end_date > $this->pollService->maxExpiryDate()) {
$poll->end_date = utf8_encode(strftime('%Y-%m-%d', $this->pollService->maxExpiryDate()));
}
return $this->pollRepository->update($poll);
} }
/** /**