mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
Fix news delete message part 2
This commit is contained in:
parent
95b1460b13
commit
2d02d8d8b3
@ -56,8 +56,9 @@ if(!empty($action))
|
||||
}
|
||||
}
|
||||
else if($action == 'delete') {
|
||||
News::delete($id, $errors);
|
||||
success("Deleted successful.");
|
||||
if (News::delete($id, $errors)) {
|
||||
success("Deleted successful.");
|
||||
}
|
||||
}
|
||||
else if($action == 'edit')
|
||||
{
|
||||
|
@ -75,8 +75,7 @@ class News
|
||||
|
||||
static public function delete($id, &$errors)
|
||||
{
|
||||
if(isset($id))
|
||||
{
|
||||
if(isset($id)) {
|
||||
$row = ModelsNews::find($id);
|
||||
if($row) {
|
||||
if (!$row->delete()) {
|
||||
@ -87,8 +86,9 @@ class News
|
||||
$errors[] = 'News with id ' . $id . ' does not exists.';
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
$errors[] = 'News id not set.';
|
||||
}
|
||||
|
||||
if(count($errors)) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user