SQl errors show up in Manage Conference

imabug - January 21, 2009 - 02:08
Project:Conference
Version:6.x-1.2-beta1
Component:Code
Category:bug report
Priority:critical
Assigned:zyxware
Status:needs review
Description

Installed the conference module in a Drupal 6.9 installation. When I go to Manage Conference, I see the following SQL error in a big pink box:

user warning: Unknown column 'c.pvid' in 'where clause' query: SELECT COUNT(*) FROM node n LEFT JOIN conference c ON n.nid = c.pnid WHERE n.type='conference_paper' AND (c.pvid = n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM conference c WHERE c.pnid = n.nid)) in /home/self/public_html/sites/all/modules/conference/conference.module on line 591.

Looking in the conference table in the DB, I don't see any pvid column, nor do I see where it would be created in the conference.install file

#1

sam.foster - January 27, 2009 - 16:40

Hi

I'm using version 6.6 and I also get this error

--- snip ----
warning: pg_query() [function.pg-query]: Query failed: ERROR: column c.pvid does not exist in /usr/share/drupal/includes/database.pgsql.inc on line 138.
user warning: query: SELECT COUNT(*) FROM node n LEFT JOIN conference c ON n.nid = c.pnid WHERE n.type='conference_paper' AND (c.pvid = n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM conference c WHERE c.pnid = n.nid)) in /export/var/drupal/webteam.bangor.ac.uk/modules/conference/conference.module on line 591.
--- snip ----

and it appears on the Manage Conference page and I also get this message

---- snip ----
warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of OR must be type boolean, not type integer in /usr/share/drupal/includes/database.pgsql.inc on line 138.
user warning: query: INSERT INTO node_access (nid, gid, realm, grant_view, grant_update, grant_delete) SELECT DISTINCT n.nid, n.uid, 'conference', 1, !(c.ruid OR d.decision), !(c.ruid OR d.decision) FROM node n LEFT JOIN conference c ON n.nid = c.pnid LEFT JOIN conference_decision d ON d.pnid = n.nid WHERE n.type = 'conference_paper' in /export/var/drupal/webteam.bangor.ac.uk/modules/conference/conference.admin.inc on line 350.
--- snip -----

on this page

admin/settings/conference

when I do stuff relating to the 'node permissions' such as clicking on the 'update the permissions table' button.

If I disable 'conference node permissions' the warning message doesn't appear on the admin/settings/conference page.

However I still get the messages on the Manage Conference page.

#2

jeannine - January 28, 2009 - 23:27

I'm getting similar warnings:

on the create paper page:

user warning: Unknown column 'c.pvid' in 'where clause' query: SELECT count(*) FROM conference c, node n where c.pnid = n.nid and c.pvid = n.vid AND n.nid = 0 in /www/share/htdocs/ASF/pi_symp/sites/all/modules/contrib/conference/conference.module on line 1461.

In manage conference:

* user warning: Unknown column 'c.pvid' in 'where clause' query: SELECT COUNT(*) FROM node n LEFT JOIN conference c ON n.nid = c.pnid WHERE n.type='conference_paper' AND (c.pvid = n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM conference c WHERE c.pnid = n.nid)) in /www/share/htdocs/ASF/pi_symp/sites/all/modules/contrib/conference/conference.module on line 591.
* user warning: Unknown column 'c.pvid' in 'where clause' query: SELECT * FROM node n LEFT JOIN conference c ON n.nid = c.pnid WHERE n.type='conference_paper' AND (c.pvid = n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM conference c WHERE c.pnid = n.nid)) ORDER BY n.created DESC LIMIT 0, 25 in /www/share/htdocs/ASF/pi_symp/sites/all/modules/contrib/conference/conference.module on line 591.

what should I do??

#3

jeannine - January 28, 2009 - 23:28

PS when I disabled node permissions it made no difference for me....

#4

infotrendy - February 6, 2009 - 10:36
Component:User interface» Code
Status:active» needs work

Hi,

I agree that this module is worth working and spend a little time to find out what these errors are. Most of them are due to oversight in spelling or code.

A few things:
admin, author, rev ROLE can not have ' ' (space) in name

things to do in data base, TABLE conference
add pvid column:
ALTER TABLE `conference` ADD `pvid` INT NOT NULL AFTER `rnid` ;

things to do in code:
(line 1461)
$sql = "SELECT COUNT(*) FROM { conference } c, { node } n where c.pnid = n.nid and c.pvid = n.vid AND n.nid = %d";

change to (remove spaces in {})

$sql = "SELECT COUNT(*) FROM {conference} c, {node} n where c.pnid = n.nid and c.pvid = n.vid AND n.nid = %d";

Now users can input papers without warning.

#5

infotrendy - February 6, 2009 - 12:20

Few more things by searching "_}"

I attach correct one.

AttachmentSize
conference.module.test 116 KB

#6

jeannine - February 7, 2009 - 22:44

Thank you! Everything is working perfectly now!!!

#7

zyxware - February 26, 2009 - 14:45
Assigned to:Anonymous» zyxware

Hello All

I am back, I was out for about 3 weeks I will look into the patches and update shorty. Thank You for your patience.

Regards
Zyxware

#8

zyxware - March 3, 2009 - 09:13
Priority:normal» critical

I checked up on the issue it seems the updated schema for the conference module was not provided with the ".install" file, I will update it and commit back to the repository shortly.

Regards
Zyxware

#9

zyxware - March 3, 2009 - 10:17

Hello All

The "conference.install" file has been patched and put back into the CVS repository. For all the people who are facing this error, please Drop the existing table called "conference"

DROP TABLE conference;

And recreate the table using the following query

CREATE TABLE conference (
        pnid int(10) NOT NULL default '0',
        pvid int(10) NOT NULL default '0',
        ruid int(10) NOT NULL default '0',
        rnid int(10) NOT NULL default '0',
        comment1 longtext NOT NULL,
        comment2 longtext NOT NULL,
        status int(11) NOT NULL default '0',
        PRIMARY KEY  (`pnid`,`ruid`, `pvid`)
)

Let me know if you are having any other issues.

In the original release I forgot to update the SQL query in the install file, that is how the issue occurred.

Sorry for inconvenience.

Regards
Zyxware

#10

zyxware - March 3, 2009 - 11:47
Status:needs work» needs review

#11

sebastiano.moruzzi - July 13, 2009 - 10:56

Though papers have been submitted to the conference, in "Manage Conference" I don't see any paper to assign reviews and I have the following error message (I have installed the last version of June 2009):

* user warning: Unknown column 'c.pvid' in 'where clause' query: SELECT COUNT(*) FROM node n LEFT JOIN conference c ON n.nid = c.pnid WHERE n.type='conference_paper' AND (c.pvid = n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM conference c WHERE c.pnid = n.nid)) in /home/gulliver/public_html/cogito/sites/default/modules/conference/conference.module on line 591.
* user warning: Unknown column 'c.pvid' in 'where clause' query: SELECT * FROM node n LEFT JOIN conference c ON n.nid = c.pnid WHERE n.type='conference_paper' AND (c.pvid = n.vid OR c.pvid is NULL OR c.pvid = (SELECT max(c.pvid) FROM conference c WHERE c.pnid = n.nid)) ORDER BY n.created DESC LIMIT 0, 25 in /home/gulliver/public_html/cogito/sites/default/modules/conference/conference.module on line 591.

 
 

Drupal is a registered trademark of Dries Buytaert.