diff --git a/src/AbstractITILChildTemplate.php b/src/AbstractITILChildTemplate.php index 90a66ad3ca4..64f7355f191 100644 --- a/src/AbstractITILChildTemplate.php +++ b/src/AbstractITILChildTemplate.php @@ -143,7 +143,7 @@ public function getRenderedContent(CommonITILObject $itil_item): string $content ); - if (!$html) { + if ($html === null) { $html = $content; } diff --git a/src/ITILSolution.php b/src/ITILSolution.php index 4e7080b4a26..79355bc84d6 100644 --- a/src/ITILSolution.php +++ b/src/ITILSolution.php @@ -275,7 +275,7 @@ public function prepareInputForAdd($input) ); // Invalid template - if (!$html) { + if ($html === null) { return false; } diff --git a/tests/functional/ITILSolution.php b/tests/functional/ITILSolution.php index e28d20ffaf6..fc1898bd3d5 100644 --- a/tests/functional/ITILSolution.php +++ b/tests/functional/ITILSolution.php @@ -584,4 +584,25 @@ public function testTicketSolutionValidation() $this->integer((int)$solution->fields['status'])->isIdenticalTo(\CommonITILValidation::ACCEPTED); $this->integer((int)$ticket->fields['status'])->isIdenticalTo($ticket::CLOSED); } + + public function testAddEmptyContent() + { + $this->login(); + + $ticket = new Ticket(); + $ticket_id = $ticket->add([ + 'name' => 'ticket title', + 'description' => 'a description', + 'content' => 'test', + ]); + $this->integer($ticket_id)->isGreaterThan(0); + + $solution = new \ITILSolution(); + $solution_id = $solution->add([ + 'itemtype' => $ticket::getType(), + 'items_id' => $ticket->getID(), + 'content' => '', + ]); + $this->integer($solution_id)->isGreaterThan(0); + } }