X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a4f6bc63f007e159068a497d558a189829dcd6ab..refs/pull/325/head:/app/Repos/EntityRepo.php diff --git a/app/Repos/EntityRepo.php b/app/Repos/EntityRepo.php index f1428735c..8a8740d76 100644 --- a/app/Repos/EntityRepo.php +++ b/app/Repos/EntityRepo.php @@ -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);