mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
Creates ticket session when an unlogged user creates a ticket.
Fixes runtime error when there is no author associated with a log.
This commit is contained in:
parent
bedf55d1ad
commit
a883f4d430
@ -115,10 +115,16 @@ class CreateController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
Log::createLog('CREATE_TICKET', $this->ticketNumber);
|
||||
Response::respondSuccess([
|
||||
'ticketNumber' => $this->ticketNumber
|
||||
]);
|
||||
|
||||
if(!Controller::isUserSystemEnabled() && !Controller::isStaffLogged()) {
|
||||
$session = Session::getInstance();
|
||||
$session->createTicketSession($this->ticketNumber);
|
||||
}
|
||||
|
||||
Log::createLog('CREATE_TICKET', $this->ticketNumber);
|
||||
}
|
||||
|
||||
private function storeTicket() {
|
||||
|
@ -68,7 +68,7 @@ class Log extends DataStore {
|
||||
'to' => $this->to,
|
||||
'author' => [
|
||||
'name' => $this->authorName,
|
||||
'id' => !$author->isNull() ? $author->id : null,
|
||||
'id' => $author && !$author->isNull() ? $author->id : null,
|
||||
'staff' => $author instanceof Staff
|
||||
],
|
||||
'date' => $this->date
|
||||
|
Loading…
x
Reference in New Issue
Block a user