mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added extendable/scalable formatter for webhook data
Creates a new organsied formatting system for webhook data, with interfaces for extending with custom model formatting rules. Allows easy usage & extension of the default bookstack formatting behaviour when customizing webhook events via theme system, and keeps default data customizations organised. This also makes the following webhook data changes: - owned_by/created_by/updated_by user details are loaded for events with Entity details. (POTENTIALLY BREAKING CHANGE). - current_revision details are loaded for page update/create events. Added testing to cover added model formatting rules. For #3279 and #3218
This commit is contained in:
@ -124,11 +124,8 @@ class PageRevisionController extends Controller
|
||||
throw new NotFoundException("Revision #{$revId} not found");
|
||||
}
|
||||
|
||||
// Get the current revision for the page
|
||||
$currentRevision = $page->getCurrentRevision();
|
||||
|
||||
// Check if its the latest revision, cannot delete latest revision.
|
||||
if (intval($currentRevision->id) === intval($revId)) {
|
||||
// Check if it's the latest revision, cannot delete the latest revision.
|
||||
if (intval($page->currentRevision->id ?? null) === intval($revId)) {
|
||||
$this->showErrorNotification(trans('entities.revision_cannot_delete_latest'));
|
||||
|
||||
return redirect($page->getUrl('/revisions'));
|
||||
|
Reference in New Issue
Block a user