Problem/Motivation

After updating to 4.1.4, we are seeing an error in the logs each time that cron runs:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "limit" LINE 1: SELECT rid FROM "smart_date_rule" WHERE `limit` IS NULL ^: SELECT rid FROM "smart_date_rule" WHERE `limit` IS NULL; Array ( ) in Drupal\smart_date_recur\RuleStorage->getRuleIdsToCheck() (line 19 of redacted/web/modules/contrib/smart_date/modules/smart_date_recur/src/RuleStorage.php).

We are running PostgreSQL 13.7 and PHP 8.2.

Issue fork smart_date-3467625

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ishore created an issue. See original summary.

ishore’s picture

I edited RuleStorage.php and modified:

return $this->database->query('SELECT rid FROM {' . $this->getBaseTable() . '} WHERE `limit` IS NULL')

to:

return $this->database->query('SELECT rid FROM {' . $this->getBaseTable() . '} WHERE "limit" IS NULL')

This appears to have fixed the issue, but not sure how this change might affect MySQL databases.

tyapchyc’s picture

Assigned: Unassigned » tyapchyc

mandclu’s picture

@tyapchyc is this ready for review?

tyapchyc’s picture

Assigned: tyapchyc » Unassigned
Status: Active » Needs review

@mandclu
yes, ready for review
Thanks

mandclu’s picture

Title: Update to 4.1.4 causes cron error » Cron error with PostgresSQL
Version: 4.1.4 » 4.2.x-dev

Updating this to target the 4.2.x branch, and since this hasn't been reported on any MySQL sites, classifying this as specific to PostgresSQL, even though it could obviously also pertain to other database engines.

  • mandclu committed fa4e403f on 4.2.x authored by tyapchyc
    Issue #3467625 by tyapchyc, mandclu: Cron error with PostgresSQL
    
mandclu’s picture

Status: Needs review » Fixed

@tyapchyc thank you for your work on this. Merged in.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.