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
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
Comment #2
ishore commentedI 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.
Comment #3
tyapchyc commentedComment #5
mandclu commented@tyapchyc is this ready for review?
Comment #6
tyapchyc commented@mandclu
yes, ready for review
Thanks
Comment #7
mandclu commentedUpdating 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.
Comment #9
mandclu commented@tyapchyc thank you for your work on this. Merged in.