I'm running Drupal 6.10, and updated biblio today to the newest version (6.x-1.0). When I try to export a citation in any format for a single biblio entry, the browser shows a blank page. The next time I load a page (anywhere on the site), I get the following error:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT * FROM drupal_node n left join drupal_biblio b on n.vid=b.vid INNER JOIN drupal_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'node_privacy_byrole_role') OR (na.gid = 0 AND na.realm = 'node_privacy_byrole_user'))) AND ( n.nid=28 /*)GROUP by n.nid*/ in example.com/sites/all/modules/biblio/biblio.import.export.inc on line 377.

The error occurs for anonymous, authenticated, and admin users, and it happens for all biblio entries. The same error does not occur when I export all entries at once (with the links at the top of the biblio page). I never tried exporting a single entry before updating, so I don't know if it worked before the update.

Comments

rjerome’s picture

I think it may have something to do with the SQL comment in that line...

I don't get this error on my sites, so could you try editing that line 377 in biblio.import.export.inc which looks like this...

    $query = db_rewrite_sql("SELECT * FROM {node} n left join {biblio} b  on n.vid=b.vid WHERE n.nid=%d /*GROUP by n.nid*/");

and change it to this...

    $query = db_rewrite_sql("SELECT * FROM {node} n left join {biblio} b  on n.vid=b.vid WHERE n.nid=%d ");

and see if that fixes the problem.

drlightx’s picture

Thanks, that worked like a charm.

drlightx’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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