mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-07-17 08:42:23 +00:00
Fixed bug which hid entities and fixed new chapter priority
This commit is contained in:
parent
c25ef18900
commit
565033e0d4
|
@ -59,7 +59,7 @@ class ChapterController extends Controller
|
||||||
|
|
||||||
$input = $request->all();
|
$input = $request->all();
|
||||||
$input['priority'] = $this->bookRepo->getNewPriority($book);
|
$input['priority'] = $this->bookRepo->getNewPriority($book);
|
||||||
$chapter = $this->chapterRepo->createFromInput($request->all(), $book);
|
$chapter = $this->chapterRepo->createFromInput($input, $book);
|
||||||
Activity::add($chapter, 'chapter_create', $book->id);
|
Activity::add($chapter, 'chapter_create', $book->id);
|
||||||
return redirect($chapter->getUrl());
|
return redirect($chapter->getUrl());
|
||||||
}
|
}
|
||||||
|
@ -171,6 +171,14 @@ class ChapterController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform the move action for a chapter.
|
||||||
|
* @param $bookSlug
|
||||||
|
* @param $chapterSlug
|
||||||
|
* @param Request $request
|
||||||
|
* @return mixed
|
||||||
|
* @throws \BookStack\Exceptions\NotFoundException
|
||||||
|
*/
|
||||||
public function move($bookSlug, $chapterSlug, Request $request) {
|
public function move($bookSlug, $chapterSlug, Request $request) {
|
||||||
$book = $this->bookRepo->getBySlug($bookSlug);
|
$book = $this->bookRepo->getBySlug($bookSlug);
|
||||||
$chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
|
$chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
|
||||||
|
|
|
@ -251,7 +251,10 @@ class BookRepo extends EntityRepo
|
||||||
}]);
|
}]);
|
||||||
$chapterQuery = $this->permissionService->enforceChapterRestrictions($chapterQuery, 'view');
|
$chapterQuery = $this->permissionService->enforceChapterRestrictions($chapterQuery, 'view');
|
||||||
$chapters = $chapterQuery->get();
|
$chapters = $chapterQuery->get();
|
||||||
$children = $pages->merge($chapters);
|
$children = $pages->values();
|
||||||
|
foreach ($chapters as $chapter) {
|
||||||
|
$children->push($chapter);
|
||||||
|
}
|
||||||
$bookSlug = $book->slug;
|
$bookSlug = $book->slug;
|
||||||
|
|
||||||
$children->each(function ($child) use ($bookSlug) {
|
$children->each(function ($child) use ($bookSlug) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user