]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/BookController.php
Show bookshelves that a book belongs to on a book view
[bookstack] / app / Http / Controllers / BookController.php
index b2fb1dcba56d38ceb4e388e0107e2b11ab7f4cf0..35f62012ab36a3a40c72813817cc7fb19c0ce101 100644 (file)
@@ -150,6 +150,7 @@ class BookController extends Controller
         $this->checkOwnablePermission('book-view', $book);
 
         $bookChildren = $this->bookRepo->getBookChildren($book);
         $this->checkOwnablePermission('book-view', $book);
 
         $bookChildren = $this->bookRepo->getBookChildren($book);
+        $bookParentShelves = $this->bookRepo->getBookParentShelves($book);
 
         Views::add($book);
         if ($request->has('shelf')) {
 
         Views::add($book);
         if ($request->has('shelf')) {
@@ -161,6 +162,7 @@ class BookController extends Controller
             'book' => $book,
             'current' => $book,
             'bookChildren' => $bookChildren,
             'book' => $book,
             'current' => $book,
             'bookChildren' => $bookChildren,
+            'bookParentShelves' => $bookParentShelves,
             'activity' => Activity::entityActivity($book, 20, 1)
         ]);
     }
             'activity' => Activity::entityActivity($book, 20, 1)
         ]);
     }
@@ -199,7 +201,7 @@ class BookController extends Controller
             'image' => $this->imageRepo->getImageValidationRules(),
         ]);
 
             'image' => $this->imageRepo->getImageValidationRules(),
         ]);
 
-         $book = $this->bookRepo->updateFromInput('book', $book, $request->all());
+         $book = $this->bookRepo->updateFromInput($book, $request->all());
          $this->bookUpdateActions($book, $request);
 
          Activity::add($book, 'book_update', $book->id);
          $this->bookUpdateActions($book, $request);
 
          Activity::add($book, 'book_update', $book->id);