]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/EntityRepo.php
Updated Dutch language files
[bookstack] / app / Repos / EntityRepo.php
index f1428735cc340149a3c33d0d3ed76e298cfe7f63..8a8740d76cf6cf18faf5a9163e2f75bb0b4d5a79 100644 (file)
@@ -332,12 +332,12 @@ class EntityRepo
                 $parents[$key] = $entities[$index];
                 $parents[$key]->setAttribute('pages', collect());
             }
-            if ($entities[$index]->chapter_id === 0) $tree[] = $entities[$index];
+            if ($entities[$index]->chapter_id === 0 || $entities[$index]->chapter_id === '0') $tree[] = $entities[$index];
             $entities[$index]->book = $book;
         }
 
         foreach ($entities as $entity) {
-            if ($entity->chapter_id === 0) continue;
+            if ($entity->chapter_id === 0 || $entity->chapter_id === '0') continue;
             $parentKey = 'BookStack\\Chapter:' . $entity->chapter_id;
             $chapter = $parents[$parentKey];
             $chapter->pages->push($entity);