Fixed chapter check for non-mysqlnd instances

Fixes #383
This commit is contained in:
Dan Brown 2017-05-07 19:34:11 +01:00
parent f8ae4c335e
commit 75981c2412
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9

View file

@ -399,7 +399,7 @@ class PermissionService
$hasPermissiveAccessToParents = !$book->restricted;
// For pages with a chapter, Check if explicit permissions are set on the Chapter
if ($entity->isA('page') && $entity->chapter_id !== 0) {
if ($entity->isA('page') && $entity->chapter_id !== 0 && $entity->chapter_id !== '0') {
$chapter = $this->getChapter($entity->chapter_id);
$hasPermissiveAccessToParents = $hasPermissiveAccessToParents && !$chapter->restricted;
if ($chapter->restricted) {