PG sql problem

spydmobile - February 4, 2008 - 21:20
Project:Filebrowser
Version:6.x-1.1-beta1
Component:Miscellaneous
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Installed the module on fairly stock drupal 6 rc3 on Postgres. The following errors are what I get when I enable the module.

* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of WHERE must be type boolean, not type integer in C:\wamp\www\WxPortal\includes\database.pgsql.inc on line 138.
* user warning: query: SELECT path, location FROM filebrowser WHERE 1 in C:\wamp\www\WxPortal\modules\filebrowser\filebrowser.module on line 8.

I have seen other modules have issues because of postgres SQL being different from expected.

#1

Susurrus - February 13, 2008 - 19:16

Have you tried changing the query in line 8 to read "SELECT path, location FROM filebrowser WHERE true"?

Also, to improve readability throw code and error message into <code> tags.

#2

spydmobile - February 22, 2008 - 21:13

No I didnt. I was just providing feedback. - I will use code tags henceforth :)

#3

Susurrus - February 22, 2008 - 21:39
Status:active» patch (code needs review)

Could you try changing that line I specified? I don't have PgSQL and don't have the resources or skills to thoroughly test this on that DB.

#4

spydmobile - February 28, 2008 - 00:03

changed existing code from:
$qry = db_query('SELECT path, location FROM {filebrowser} WHERE 1');
to:
$qry = db_query('SELECT path, location FROM filebrowser WHERE true');
then enabled the module in D6.1 and got the no errors, but when I copnfigured the module at:
admin/settings/filebrowser
I got:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of WHERE must be type boolean, not type integer in C:\ms4w\Apache\htdocs\itportal\includes\database.pgsql.inc on line 138.
    * user warning: query: SELECT path, location, can_explore FROM filebrowser WHERE 1 in C:\ms4w\Apache\htdocs\itportal\modules\filebrowser\filebrowser.module on line 113.

Changed the 1 to a true on line 113 (112 in original file) and error was gone.
Tried to configure with my directories and got:
    * warning: pg_query() [function.pg-query]: Query failed: ERROR: column "c:\\ms4w\\Apache\\htdocs\\itportal" does not exist at character 68 in C:\ms4w\Apache\htdocs\itportal\includes\database.pgsql.inc on line 138.
    * user warning: query: SELECT COUNT(1) FROM menu_router mr, menu_links ml WHERE mr.path = "c:\\ms4w\\Apache\\htdocs\\itportal" OR ml.link_path = "c:\\ms4w\\Apache\\htdocs\\itportal" in C:\ms4w\Apache\htdocs\itportal\modules\filebrowser\filebrowser.module on line 193.
    * You must specify a valid directory.

The directories are valid windows directories.

#5

Susurrus - February 28, 2008 - 01:28

The last set of errors looks like the insert SQL statement failed, not that the directory was invalid. I'll see if I can look into that statement later.

#6

spydmobile - February 28, 2008 - 15:41

ok cool, FYI the line numbers in the error are one line higher than in your file because I put a comment in the file to note my changes.

#7

spydmobile - April 1, 2008 - 17:53

bump?

#8

Susurrus - May 3, 2008 - 22:01
Status:patch (code needs review)» fixed

#9

Anonymous (not verified) - May 17, 2008 - 22:11
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.