Attempt to fix bookchildren and user getThumb
Hopefully Fixes #292 and #294 and #287
Showing
3 changed files
with
6 additions
and
4 deletions
| ... | @@ -332,12 +332,12 @@ class EntityRepo | ... | @@ -332,12 +332,12 @@ class EntityRepo |
| 332 | $parents[$key] = $entities[$index]; | 332 | $parents[$key] = $entities[$index]; |
| 333 | $parents[$key]->setAttribute('pages', collect()); | 333 | $parents[$key]->setAttribute('pages', collect()); |
| 334 | } | 334 | } |
| 335 | - if ($entities[$index]->chapter_id === 0) $tree[] = $entities[$index]; | 335 | + if ($entities[$index]->chapter_id === 0 || $entities[$index]->chapter_id === '0') $tree[] = $entities[$index]; |
| 336 | $entities[$index]->book = $book; | 336 | $entities[$index]->book = $book; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | foreach ($entities as $entity) { | 339 | foreach ($entities as $entity) { |
| 340 | - if ($entity->chapter_id === 0) continue; | 340 | + if ($entity->chapter_id === 0 || $entity->chapter_id === '0') continue; |
| 341 | $parentKey = 'BookStack\\Chapter:' . $entity->chapter_id; | 341 | $parentKey = 'BookStack\\Chapter:' . $entity->chapter_id; |
| 342 | $chapter = $parents[$parentKey]; | 342 | $chapter = $parents[$parentKey]; |
| 343 | $chapter->pages->push($entity); | 343 | $chapter->pages->push($entity); | ... | ... |
| ... | @@ -165,7 +165,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon | ... | @@ -165,7 +165,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon |
| 165 | if ($imageId === 0 || $imageId === '0' || $imageId === null) return $default; | 165 | if ($imageId === 0 || $imageId === '0' || $imageId === null) return $default; |
| 166 | 166 | ||
| 167 | try { | 167 | try { |
| 168 | - $avatar = baseUrl($this->avatar->getThumb($size, $size, false)); | 168 | + $avatar = $this->avatar ? baseUrl($this->avatar->getThumb($size, $size, false)) : $default; |
| 169 | } catch (\Exception $err) { | 169 | } catch (\Exception $err) { |
| 170 | $avatar = $default; | 170 | $avatar = $default; |
| 171 | } | 171 | } | ... | ... |
| ... | @@ -47,7 +47,9 @@ | ... | @@ -47,7 +47,9 @@ |
| 47 | ], | 47 | ], |
| 48 | "post-install-cmd": [ | 48 | "post-install-cmd": [ |
| 49 | "Illuminate\\Foundation\\ComposerScripts::postInstall", | 49 | "Illuminate\\Foundation\\ComposerScripts::postInstall", |
| 50 | - "php artisan optimize" | 50 | + "php artisan optimize", |
| 51 | + "php artisan cache:clear", | ||
| 52 | + "php artisan view:clear" | ||
| 51 | ], | 53 | ], |
| 52 | "post-update-cmd": [ | 54 | "post-update-cmd": [ |
| 53 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", | 55 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", | ... | ... |
-
Please register or sign in to post a comment