fix php warnings and propperly handle failure of cancelCheckout()

This commit is contained in:
Uwe Steinmann 2022-05-20 17:40:04 +02:00
parent 20b03dcbe0
commit eb4b28ea8c

View File

@ -46,9 +46,8 @@ if(empty($_POST['confirm'])) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("operation_disallowed"));
}
$document->cancelCheckOut($comment);
if (is_bool($result) && !$result) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
if(!$document->cancelCheckOut()) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_cancel_checkout"));
}
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_cancel_checkout')));
add_log_line("?documentid=".$documentid);