Comment 7 for bug 1796945

Revision history for this message
tji@sitka.bclibraries.ca (tji) wrote :

We observed two types of issues with templates cloned from XUL:

1. error when running reports
2. inaccurate result

The fix helps with #2, but does not solve #1.

For #1, we usually see two types of errors: one is missing FROM clause, the other a field needs be in GROUP BY. Below is an example of the latter from today's test. I did not encounter the former today.

DBD::Pg::st execute failed: ERROR: column "f45381a54504218e39aca33492d29306.circ_lib" must appear in the GROUP BY clause or be used in an aggregate function LINE 8: HAVING "f45381a54504218e39aca33492d29306"."circ_lib" IN ($... ^ at /srv/openils/bin/clark-kent.pl line 255.

By comparing the cloned template with a new template directly created on the Webby, I noticed that the cloned template has an empty "where" section, but have the conditions in "having" section (copied an example portion below). Moving the conditions to "where" section solved the problem.

"where":[],"having":[{"alias":"Circulating Library","path .......

Note that I have at least one cloned template that has both "where" and "having" sections, but causes the GROUP BY error. It could be related to individual fields in each sections.

Testing on #2 shows positive result. I chose a template that relies on the hidden left join from Invoice table to Invoice Entry and to Invoice Items. The cloned template with Jason's fix produced the same result as the XUL template. But the one cloned without the fix produced a shorter result list.

More testing will be on the missing FROM clause error and impact of Jason's fix on templates having right join (unlikely an issue).

Tina Ji
BC Libraries Coop