I am running Drupal 4.7.2 on Windows XP Pro, Apache 2.2, MySQL 4.1, PHP5, and when I try to view a review that is attached to a node, I get this error:

* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\website\includes\database.mysql.inc on line 349.
* user warning: Unknown column 'nodereview.parent' in 'where clause' query: SELECT count(node.nid) FROM drupal_node node LEFT JOIN drupal_nodereview nodereview ON node.nid = nodereview.nid WHERE (nodereview.parent AND '') AND (reviewed_nid = '4') AND (nodereview.nid = node.nid) in C:\website\includes\database.mysql.inc on line 120.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\website\includes\database.mysql.inc on line 349.
* user warning: Unknown column 'nodereview.parent' in 'where clause' query: SELECT node.nid FROM drupal_node node LEFT JOIN drupal_nodereview nodereview ON node.nid = nodereview.nid WHERE (nodereview.parent AND '') AND (reviewed_nid = '4') AND (nodereview.nid = node.nid) ORDER BY node.changed DESC LIMIT 0, 10 in C:\website\includes\database.mysql.inc on line 120.

The review is added, and can be seen if you access the node directly, but when viewing the parent node of the review, when the review tab is hit, that should display all reviews of the parent node, that is when I receive this error.

Thanks
Greg

CommentFileSizeAuthor
nodevote.module_2.patch0 bytesGman

Comments

Crell’s picture

Do you have the Views module installed? That page requires the views module to be installed and enabled. Also, check to make sure the database tables are indeed created properly. Nodereview has a .install file so it should create everything correctly, but it's good to check and be sure.

Also, why the empty patch labeled for a different module? :-)

Gman’s picture

Yes I did have views installed and I the tables are all present. I also have the votingAPI installed as well, since I was testing the userreview andnodereview modules at the same time.

I thought maybe it would have something to do with the double 'AND ") AND' in each SQL statement.

Sorry about the attachment, it was from an earlier comment I made on another thread and somehow it was added here. I can't seem to edit these entries, so it is stuck there.

mwu’s picture

I have the same situation. (on unix)

Gman, I'm correct in thinking the attached patch is not a patch for this module, but was attached by mistake?

Gman’s picture

Yes, it was from a prior submission. I don't know how it was attached, maybe cached in my browser from the last and sent with the new one.

ATTACHED PATCH IS MISTAKENLY ATTACHED. Sorry.

It should be removed if possible.

Gman’s picture

I have localized this error to the below code in nodereview_views.inc file. At the bottom in the nodereview_views_default_views() function. I don't know exactly what is going on here, but when I remove this portion from the file, it all works perfectly.

 $view->filter = array (
    array (
      'tablename' => 'nodereview',
      'field' => 'parent',
      'operator' => 'AND',
      'options' => '',
      'value' => array (
),
    ),
  );

Again, this is on 4.7, and views is definitely working correctly. I don't know what this code snip does, so I don't know how to write a patch, or if just removing it is OK. But for now, I am just removing it for my installation. -Gman

netceo’s picture

facing exactly the same problem. Not solved by removing these lines either. I liked the module, but cannot use it.. Can somebody suggest a solution here?

Crell’s picture

Hey guys. It's strange, but I've not been able to reproduce this issue here. I'll play with it some more as soon as I have some time and try to figure out what's going on. Unfortunately right now I'm in the process of trying to launch a CivicSpace site that is taking up all my spare time. :-)

Meanwhile, can you check what your exact version of both noderview and views is? views has multiple schema versions. Please check which you're running and let me know, so that I know we're using the same version.

Are you running this against 4.7 or HEAD?

Gman’s picture

I am using the latest 4.7 version of views, and 4.7.2 of drupal.

For the me, the issue really is that section I quoted earlier. With that gone, I am able to use this module.

mbarulli’s picture

I have the same issue on a linux machine.
Not solved by removing those lines of code ...

I would really appreciate any help!

Many thanks in advance,
Marco

noid’s picture

Hi,

Has anybody figured this out yet? Am using 4.7.3. This would really be a crucial module for my site which has movie reviews. Thanks in advance! :)

Crell’s picture

Status: Active » Fixed

My apologies for taking so long to get to this, folks. I tracked down the problem, though. Why it never showed up for me before I don't know, but it was a simple fix. I just checked in a new 4.7 version that should be working properly without silly SQL errors.

Cheers.

Anonymous’s picture

Status: Fixed » Closed (fixed)