Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2017-02-01 22:16:32 +0000
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
9eecaea31a0f9a5f79bdf7792838e956174a3e71
9eecaea3
1 parent
492e2f17
Attempt to fix bookchildren and user getThumb
Hopefully Fixes #292 and #294 and #287
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
app/Repos/EntityRepo.php
app/User.php
composer.json
app/Repos/EntityRepo.php
View file @
9eecaea
...
...
@@ -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
);
...
...
app/User.php
View file @
9eecaea
...
...
@@ -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
;
}
...
...
composer.json
View file @
9eecaea
...
...
@@ -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"
,
...
...
Please
register
or
sign in
to post a comment