Fixed issue with the book sort not showing all books in sidebar
Showing
2 changed files
with
4 additions
and
2 deletions
| ... | @@ -157,7 +157,7 @@ class BookController extends Controller | ... | @@ -157,7 +157,7 @@ class BookController extends Controller |
| 157 | $this->checkPermission('book-update'); | 157 | $this->checkPermission('book-update'); |
| 158 | $book = $this->bookRepo->getBySlug($bookSlug); | 158 | $book = $this->bookRepo->getBySlug($bookSlug); |
| 159 | $bookChildren = $this->bookRepo->getChildren($book); | 159 | $bookChildren = $this->bookRepo->getChildren($book); |
| 160 | - $books = $this->bookRepo->getAll(); | 160 | + $books = $this->bookRepo->getAll(false); |
| 161 | $this->setPageTitle('Sort Book ' . $book->getShortName()); | 161 | $this->setPageTitle('Sort Book ' . $book->getShortName()); |
| 162 | return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]); | 162 | return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]); |
| 163 | } | 163 | } | ... | ... |
| ... | @@ -42,7 +42,9 @@ class BookRepo | ... | @@ -42,7 +42,9 @@ class BookRepo |
| 42 | */ | 42 | */ |
| 43 | public function getAll($count = 10) | 43 | public function getAll($count = 10) |
| 44 | { | 44 | { |
| 45 | - return $this->book->orderBy('name', 'asc')->take($count)->get(); | 45 | + $bookQuery = $this->book->orderBy('name', 'asc'); |
| 46 | + if (!$count) return $bookQuery->get(); | ||
| 47 | + return $bookQuery->take($count)->get(); | ||
| 46 | } | 48 | } |
| 47 | 49 | ||
| 48 | /** | 50 | /** | ... | ... |
-
Please register or sign in to post a comment