mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-01 10:50:37 +02:00
Pages Plugin: Fix delete() action
This commit is contained in:
@@ -505,10 +505,13 @@
|
||||
// Delete page and update <parent> fields
|
||||
if ($pages->deleteWhere('[slug="'.$page['slug'].'" ]')) {
|
||||
|
||||
$_pages = $pages->select('[parent="'.$page['slug'].'"]', 'all');
|
||||
$_pages = $pages->select('[parent="'.$page['slug'].'"]');
|
||||
|
||||
if(!empty($_pages)) {
|
||||
foreach($_pages as $_page) {
|
||||
$pages->updateWhere('[slug="'.$_page['slug'].'"]', array('parent' => ''));
|
||||
}
|
||||
}
|
||||
|
||||
File::delete(STORAGE . DS . 'pages' . DS . $page['id'] . '.page.txt');
|
||||
Notification::set('success', __('Page <i>:page</i> deleted', 'pages', array(':page' => Html::toText($page['title']))));
|
||||
|
Reference in New Issue
Block a user