I've see that this issue has been found in previous versions of Drupal (D6) but it stills happens when running OA2 with PostgreSQL. In my case it happens when working with the OA Discussions views.

I found a patch in the following drupal.org link that it works for me so far. But with the need of one more step cause it then raises an error for the use of a MySQL function (UNIX_TIMESTAMP()) in a PSQL query.

In the file views_handler_field_oa_new_post.inc (line 21) it says:

$this->field_alias = $this->query->add_field(NULL, "CASE WHEN $field IS NULL AND ($node.changed > (UNIX_TIMESTAMP() - $limit)) THEN 1 ELSE 0 END", $this->table . '_' . $this->field, $params);

I changed to

$this->field_alias = $this->query->add_field(NULL, "CASE WHEN $field IS NULL AND ($node.changed > (".time()." - $limit)) THEN 1 ELSE 0 END", $this->table . '_' . $this->field, $params);

I hope this helps.

Comments

Argus’s picture

Status: Active » Needs review
mpotter’s picture

Status: Needs review » Fixed

Commited a variation of this to f0c69d8. Actually doing the entire time()-$limit in PHP code now.

Status: Fixed » Closed (fixed)

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