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 |
Jump to:
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
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
No I didnt. I was just providing feedback. - I will use code tags henceforth :)
#3
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
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
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
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
bump?
#8
#9
Automatically closed -- issue fixed for two weeks with no activity.