Cron fails with read only mode enabled

Created on 12 December 2022, over 1 year ago
Updated 4 July 2023, 12 months ago

Problem/Motivation

Running Drupal's cron fails when read only mode is enabled. It doesn't matter if it has been triggered via the browser or drush cron, I get the following error:

TypeError: _readonlymode_form_list_check(): Argument #2 ($list) must be of type array, string given, called in web/modules/contrib/readonlymode/readonlymode.module on line 227 in _readonlymode_form_list_check() (line 248 of web/modules/contrib/readonlymode/readonlymode.module).

This can happen when you put the site in read only mode to prevent users editing content while you do a deployment or perform other changes as admin and forget to temporarily stop the server cron job executing the sites cron. Another scenario is a site that synchronizes data with external sources (i. e. reading external data like currency exchange or stock rates) and during a deployment/update you want to make sure the external data is synchronized in and up-to-date before you let users change data, i. e. put items into their cart or do a checkout on commerce sites.

Steps to reproduce

  • Install and enable read only mode.
  • Run cron.

Proposed resolution

Allow cron tasks to execute while read only mode is enabled.

🐛 Bug report
Status

Postponed

Version

1.1

Component

Code

Created by

🇦🇹Austria mvonfrie

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