Fix #14987 - Weird error for empty collation

Fixes: #14987
Pull-request: #15031

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2019-06-22 11:53:01 +02:00
commit 562ce3a8f6
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
2 changed files with 24 additions and 0 deletions

View File

@ -139,6 +139,18 @@ if (isset($_POST['submitcollation'])
$response->addJSON('message', $message);
exit;
}
} elseif (isset($_POST['submitcollation'])
&& isset($_POST['db_collation'])
&& empty($_POST['db_collation'])
) {
$response = Response::getInstance();
if ($response->isAjax()) {
$response->setRequestStatus(false);
$response->addJSON(
'message',
Message::error(__('No collation provided.'))
);
}
}
/**

View File

@ -214,6 +214,18 @@ if (isset($_POST['submitoptions'])) {
$GLOBALS['db'], $GLOBALS['table'], $_POST['tbl_collation']
);
}
if (isset($_POST['tbl_collation']) && empty($_POST['tbl_collation'])) {
$response = Response::getInstance();
if ($response->isAjax()) {
$response->setRequestStatus(false);
$response->addJSON(
'message',
Message::error(__('No collation provided.'))
);
exit;
}
}
}
/**
* Reordering the table has been requested by the user