Error in PLN OJS 2.4.8.0 with postgresql

,

Hi,

When I start the job:
php /var/www/revistas/tools/runScheduledTasks.php /var/www/revistas/plugins/generic/pln/xml/scheduledTasks.xml
DB Error: ERROR: column “i.last_modified” must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT DISTINCT pdo.deposit_object_id, i.last_modified as is…
^ojs2: DB Error: ERROR: column “i.last_modified” must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT DISTINCT pdo.deposit_object_id, i.last_modified as is…

File: ojs/plugins/generic/pln/classes/DepositObjectDAO.inc.php

The query:
SELECT DISTINCT pdo.deposit_object_id, i.last_modified as issue_modified, max(a.last_modified) as article_modified
FROM issues i
LEFT JOIN pln_deposit_objects pdo ON pdo.object_id = i.issue_id
LEFT JOIN published_articles pa ON pa.issue_id = i.issue_id
LEFT JOIN articles a ON a.article_id = pa.article_id
WHERE (pdo.date_modified < a.last_modified OR pdo.date_modified < i.last_modified)
AND (pdo.journal_id = 148)
GROUP BY pdo.deposit_object_id;

My sugestion:
SELECT DISTINCT pdo.deposit_object_id, i.last_modified as issue_modified, max(a.last_modified) as article_modified
FROM issues i
LEFT JOIN pln_deposit_objects pdo ON pdo.object_id = i.issue_id
LEFT JOIN published_articles pa ON pa.issue_id = i.issue_id
LEFT JOIN articles a ON a.article_id = pa.article_id
WHERE (pdo.date_modified < a.last_modified OR pdo.date_modified < i.last_modified)
AND (pdo.journal_id = 148)
GROUP BY pdo.deposit_object_id, i.last_modified;

I found it because I activated the PLN for journal and was not working.
Can anyone tell me now are getting the data from this journal?
The link is http://www.revistas.usp.br/geousp and ID is 8A6608DF-474E-4B73-AA3B-17C2C2CEFE2A

Best regards,

Tarcisio Pereira

Hi Tarcisio,

Thanks for reporting this. We’re aware of the issue and will include a fix in the upcoming OJS 2.4.8-1 release. Until then, you should disable the PKP PLN plugin.

Mark

Hi @Tarcisio_Pereira,

The fix is available here: Clean up the SQL in markHavingUpdatedContent(). by ubermichael · Pull Request #867 · pkp/ojs · GitHub

You may be able to work around the problem before 2.4.8-1 is released by applying that.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher and @mjordan

Fix applied.

Best regards,
Tarcisio Pereira.