]> BookStack Code Mirror - bookstack/blobdiff - app/Chapter.php
Added further tests, Fixed speed_update issues, improved search result query count
[bookstack] / app / Chapter.php
index c3001b69bd43778c2228f907901f5d3d8823b304..b6c8684a00069de44dc1341d77da27cc45410cd4 100644 (file)
@@ -3,7 +3,6 @@
 
 class Chapter extends Entity
 {
-
     protected $fillable = ['name', 'description', 'priority', 'book_id'];
 
     public function book()
@@ -18,7 +17,7 @@ class Chapter extends Entity
 
     public function getUrl()
     {
-        $bookSlug = isset($this->bookSlug) ? $this->bookSlug : $this->book->slug;
+        $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug;
         return '/books/' . $bookSlug. '/chapter/' . $this->slug;
     }