Skip to content

Commit

Permalink
Fix logic for <1 week request re-opening
Browse files Browse the repository at this point in the history
This was broken by doing a check of a date vs a string, instead of two
dates.

Fixes #616
  • Loading branch information
stwalkerster committed Oct 14, 2020
1 parent 0012f55 commit 632b3f6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions includes/Pages/RequestAction/PageDeferRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ protected function main()
$closureDate = $request->getClosureDate();
$date = new DateTime();
$date->modify("-7 days");
$oneweek = $date->format("Y-m-d H:i:s");


if ($request->getStatus() == "Closed" && $closureDate < $oneweek) {
if ($request->getStatus() == "Closed" && $closureDate < $date) {
if (!$this->barrierTest('reopenOldRequest', $currentUser, 'RequestData')) {
throw new ApplicationLogicException(
"You are not allowed to re-open a request that has been closed for over a week.");
Expand Down

0 comments on commit 632b3f6

Please sign in to comment.