Update more modules to throw exceptions

This commit is contained in:
Kijin Sung 2018-09-05 23:12:08 +09:00
parent c1cbc5dbdb
commit be1ce69073
21 changed files with 142 additions and 116 deletions

View file

@ -250,9 +250,18 @@ class editorAdminController extends editor
$args->enabled = $enabled;
$args->site_srl = $site_srl;
// Check if the component exists
if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
else $output = executeQuery('editor.isSiteComponentInserted', $args);
if($output->data->count) return $this->setError('msg_component_is_not_founded');
if(!$site_srl)
{
$output = executeQuery('editor.isComponentInserted', $args);
{
else
{
$output = executeQuery('editor.isSiteComponentInserted', $args);
}
if($output->data->count)
{
return new BaseObject(-1, 'msg_component_is_not_founded');
}
// Inert a component
$args->list_order = getNextSequence();
if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);