FIX: fix duplicate url

In this way, deleted page will no longer "occupy" url.
This commit is contained in:
Michal Kváček
2016-04-06 02:13:15 +02:00
parent c3085180c0
commit b7c70bab7e
+4 -2
View File
@@ -222,7 +222,9 @@ class EditContent extends Controller
}
// change url to something unique
$page->url = uniqid($page->url.'_');
$oldURL = $page->url;
$page->url = uniqid($page->url.'_deleted');
$page->save();
list ($revision, $changedColumns) = $page->updateWithHistory(['status' => 'status'], ['status' => Content::STATUS_DELETED]);
@@ -241,7 +243,7 @@ class EditContent extends Controller
->route('content.overview')
->with('success', trans('admin/contents.pageDeleted', [
'name' => $page->title,
'url' => $page->url
'url' => $oldURL
]));
}