Wrong query expression in Postgresql for sales report

Created on 23 July 2018, over 6 years ago
Updated 13 October 2023, about 1 year ago

The query expression in src/Plugin/views/field/ReportDateField.php query() works for MySQL but not PostgreSQL.

The line $expression = $this->query->getDateFormat("FROM_UNIXTIME($this->tableAlias.$this->realField)", $this->dateFormatString);
needs to be $expression = $this->query->getDateFormat("TO_TIMESTAMP($this->tableAlias.$this->realField)", $this->dateFormatString);

Not sure how to achieve that in DB independent way - maybe use getDateField()

Linked to https://www.drupal.org/project/commerce_reports/issues/2944508

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Jons

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