Final tweaks after code review and fixing failing test cases.

This commit is contained in:
Abijeet
2018-09-16 01:12:36 +05:30
parent 81d3bdc168
commit 0c8b6b7324
7 changed files with 22 additions and 24 deletions

View File

@ -475,10 +475,10 @@ class PageController extends Controller
}
// Get the current revision for the page
$current = $revision->getCurrent();
$currentRevision = $page->getCurrentRevision();
// Check if its the latest revision, cannot delete latest revision.
if (intval($current->id) === intval($revId)) {
if (intval($currentRevision->id) === intval($revId)) {
session()->flash('error', trans('entities.revision_cannot_delete_latest'));
return view('pages/revisions', ['page' => $page, 'book' => $page->book, 'current' => $page]);
}