mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-08 22:40:07 +00:00
add priority on page and chapter create
This commit is contained in:
parent
b1b8067cbe
commit
4d399f6ba7
2 changed files with 2 additions and 2 deletions
app/Entities/Repos
|
@ -49,7 +49,7 @@ class ChapterRepo
|
||||||
{
|
{
|
||||||
$chapter = new Chapter();
|
$chapter = new Chapter();
|
||||||
$chapter->book_id = $parentBook->id;
|
$chapter->book_id = $parentBook->id;
|
||||||
$chapter->priority = (new BookContents($parentBook))->getLastPriority() + 1;
|
$chapter->priority = $chapter->priority ?: (new BookContents($parentBook))->getLastPriority() + 1;
|
||||||
$this->baseRepo->create($chapter, $input);
|
$this->baseRepo->create($chapter, $input);
|
||||||
Activity::add(ActivityType::CHAPTER_CREATE, $chapter);
|
Activity::add(ActivityType::CHAPTER_CREATE, $chapter);
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ class PageRepo
|
||||||
|
|
||||||
$draft->draft = false;
|
$draft->draft = false;
|
||||||
$draft->revision_count = 1;
|
$draft->revision_count = 1;
|
||||||
$draft->priority = $this->getNewPriority($draft);
|
$draft->priority = $draft->priority ?: $this->getNewPriority($draft);
|
||||||
$draft->save();
|
$draft->save();
|
||||||
|
|
||||||
$this->revisionRepo->storeNewForPage($draft, trans('entities.pages_initial_revision'));
|
$this->revisionRepo->storeNewForPage($draft, trans('entities.pages_initial_revision'));
|
||||||
|
|
Loading…
Add table
Reference in a new issue