Fix ability to update an existing poll (6122)
This commit is contained in:
parent
cd9b00d0e9
commit
6d8c60c88b
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user