Dan Brown

Fixed chapter check for non-mysqlnd instances

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