Hello

I just install node_privacy_byrole module in my Drupal 463 testing site. In this site i just have the bookreview plus node_privacy_byrole modules installed.

Whitout node_provacy_byrole => NO problem.
With node_provacy_byrole installed => bug at the following link
http://localhost/drupal463/?q=bookreview

I got this result

user error: Erreur de syntaxe pr�s de '(n.nid), n.title, b.booktitle, b.cover, b.publisher, b.isbn, b.c' � la ligne 1
query: SELECT DISTINCT b.DISTINCT(n.nid), n.title, b.booktitle, b.cover, b.publisher, b.isbn, b.copyright, b.pages, b.rating FROM bookreview b INNER JOIN node n ON b.nid = n.nid WHERE n.type = 'bookreview' ORDER BY b.booktitle ASC LIMIT 0, 20 in c:\programme\easyphp1-8\www\drupal463\includes\database.mysql.inc on line 66.

I Found the problem, but i can't solve it.
It is in database.inc
line 243 => $query = preg_replace('/(SELECT.*)('. $primary_table .'\.)?(?

Before line 243 the debugger report :
$query = "SELECT DISTINCT (b.nid), n.title, b.booktitle, b.cover, b.publisher, b.isbn, b.copyright, b.pages, b.rating FROM {bookreview} b INNER JOIN {node} n ON b.nid = n.nid WHERE n.type = 'bookreview'"
$primary_table =n
$primary_field = nid
$field_to_select = DISTINCT(n.nid)

After line 243 the debuger report :
$query = SELECT DISTINCT (b.DISTINCT(n.nid)), n.title, b.booktitle, b.cover, b.publisher, b.isbn, b.copyright, b.pages, b.rating FROM {bookreview} b INNER JOIN {node} n ON b.nid = n.nid WHERE n.type = 'bookreview'

=> there is a double DISTINCT which make the query to fail.

How to solve that ???

Comments

chx’s picture

Project: Drupal core » node privacy byrole
Version: 4.6.3 »
Component: database system » Code
Priority: Critical » Normal
chx’s picture

Version: » 4.6.x-1.x-dev
jondoesdrupal’s picture

Status: Active » Closed (fixed)

Tidying up old issues. Focus now is on Drupal 5 version of the module. If there is still demand for this to be resolved and it gets resumbitted then I'll look into finding a solution.