Access Policy errors when Book nodes exists.

Created on 19 January 2023, over 1 year ago
Updated 28 January 2023, over 1 year ago

Problem/Motivation

Access Policy causes errors when Book nodes exists.

Steps to reproduce

Add a Book page
Navigate to /admin/people/access_policy/add and add Access Policy
Select Entity Type [Content]
ACCESS POLICY TYPE: Private
ACCESS RULES: Authored by current user
Validation operator: All
I've tried different combinations of these.

Now attempt to edit an existing node (doesn't have to be a Book node)
Result: "The website encountered an unexpected error. Please try again later."

Error log shows
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'book.nid' in 'on clause': SELECT "b".* FROM "book" "b" LEFT OUTER JOIN "content_access_policy" "content_access_policy" ON content_access_policy.content_entity_id = book.nid AND content_access_policy.content_entity_type_id = 'node' WHERE ("b"."nid" IN (:db_condition_placeholder_0)) AND (("content_access_policy"."access_policy" = :db_condition_placeholder_1) OR ("content_access_policy"."access_policy" IS NULL) OR ("content_access_policy"."access_policy" = :db_condition_placeholder_2)); Array ( [:db_condition_placeholder_0] => 53 [:db_condition_placeholder_1] => access_policy_1 [:db_condition_placeholder_2] => ) in Drupal\book\BookOutlineStorage->loadMultiple() (line 55 of /var/www/biblediscovery/web/core/modules/book/src/BookOutlineStorage.php).

System Details

Drupal Version: 9.4.9

Web Server: nginx/1.23.2

PHP Version: 8.1.13

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States GarChris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024