Conflict between Scheduled publishing and Content Access sql query modifications

Created on 31 March 2017, about 8 years ago
Updated 28 April 2023, almost 2 years ago

When Content Access is enabled, Scheduler lightweight cron is unusable for an anonymous user.
It's a problem because cron job is launched as a Drupal anonymous user and nodes can't be published at time.

It seems that Content Access removes the line which grant access to the node in node_access table, when the node is saved with a scheduling time.

This query solves the problem for one time and one node ([nid]) :

INSERT INTO `node_access` (`nid`, `langcode`, `fallback`, `gid`, `realm`, `grant_view`, `grant_update`, `grant_delete`) VALUES ('[nid]', 'fr', '1', '0', 'all', '1', '0', '0');
[nid] is for the example.

This query part seems to be added by Content Access when Scheduler selects nodes to be published :

... AND ( EXISTS  (
    SELECT na.nid AS nid
    FROM node_access na
    WHERE (
      ((gid IN  (0)) AND (realm = 'all') )
      OR( (gid IN  (0)) AND (realm = 'content_access_author') )
      OR( (gid IN  (1)) AND (realm = 'content_access_roles') )
    )
    AND (na.grant_view >= 1) 
    AND (base_table.nid = na.nid) ...
  )

I'm not sure that the problem is only due to Content Access, so I have duplicated this issue to Scheduler module page ( https://www.drupal.org/node/2865795 ).

Thanks.

Enzo

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇫🇷France EnzoFr

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.71.5 2024