Add all groups doesn't work in postgres (patch attached)
halcyonCorsair - September 30, 2009 - 22:21
| Project: | OG Contact |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | PostgreSQL |
Jump to:
Description
You need to use 's to quote in queries instead of "s or the query won't work in postgres. Also %d's don't need to be quoted.
- db_query('INSERT INTO {og_contact} (gid, reply, notpublic) VALUES ("%d","%s", "%d")', $gid->nid, "", $notpublic);
+ db_query("INSERT INTO {og_contact} (gid, reply, notpublic) VALUES (%d,'%s', %d)", $gid->nid, "", $notpublic);
| Attachment | Size |
|---|---|
| og_contact-add_all_groups-sql_fix.patch | 1.81 KB |

#1
Thanks for the patch. It patches cleanly, and doesn't seem to break anything.
I took a quick look over all the calls to db_query(), and those seem to be the only offending lines.
Leaving this issue open until I commit the change.
#2
Should be fixed in the 6.x dev version dated later than: 2009-Oct-16. Thanks again halcyonCorsair for the patch.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.