$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);
if ($imageId === 0 || $imageId === '0' || $imageId === null) return $default;
try {
- $avatar = baseUrl($this->avatar->getThumb($size, $size, false));
+ $avatar = $this->avatar ? baseUrl($this->avatar->getThumb($size, $size, false)) : $default;
} catch (\Exception $err) {
$avatar = $default;
}
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
- "php artisan optimize"
+ "php artisan optimize",
+ "php artisan cache:clear",
+ "php artisan view:clear"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",