mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-19 19:06:56 +03:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d3264bc63 | ||
|
|
d71f819f95 | ||
|
|
80f844139c | ||
|
|
9eecaea31a | ||
|
|
ee13509760 | ||
|
|
82d7bb1f32 | ||
|
|
492e2f173e |
@@ -208,7 +208,7 @@ class BookController extends Controller
|
||||
}
|
||||
|
||||
// Update permissions on changed models
|
||||
$this->entityRepo->buildJointPermissions($updatedModels);
|
||||
if (count($updatedModels) === 0) $this->entityRepo->buildJointPermissions($updatedModels);
|
||||
|
||||
return redirect($book->getUrl());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -243,13 +243,14 @@ class PermissionService
|
||||
*/
|
||||
protected function deleteManyJointPermissionsForEntities($entities)
|
||||
{
|
||||
if (count($entities) === 0) return;
|
||||
$query = $this->jointPermission->newQuery();
|
||||
foreach ($entities as $entity) {
|
||||
$query->orWhere(function($query) use ($entity) {
|
||||
$query->where('entity_id', '=', $entity->id)
|
||||
->where('entity_type', '=', $entity->getMorphClass());
|
||||
});
|
||||
}
|
||||
foreach ($entities as $entity) {
|
||||
$query->orWhere(function($query) use ($entity) {
|
||||
$query->where('entity_id', '=', $entity->id)
|
||||
->where('entity_type', '=', $entity->getMorphClass());
|
||||
});
|
||||
}
|
||||
$query->delete();
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@
|
||||
],
|
||||
"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",
|
||||
|
||||
2
public/css/export-styles.css
vendored
2
public/css/export-styles.css
vendored
File diff suppressed because one or more lines are too long
2
public/css/styles.css
vendored
2
public/css/styles.css
vendored
File diff suppressed because one or more lines are too long
@@ -119,6 +119,11 @@ sup, .superscript {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
sub, .subscript {
|
||||
vertical-align: sub;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: monospace;
|
||||
white-space:pre;
|
||||
|
||||
Reference in New Issue
Block a user