Hello,
I've found some problems using menu_stp with PostgreSQL (8.2). First, the install-Script does not create the needed table, Fix for this would be like:
menu_stp.install:
case 'pgsql':
db_query("CREATE TABLE menu_stp_roles (mid INT NOT NULL, rid INT NOT NULL, PRIMARY KEY (mid, rid))");
Second Problem is the insert in menu_stp_form_submission (menu_stp.module), only did this quick fixes to make it work for me, maybe it helps you in further development.
if($sel && !$hasp) { // role gets permission
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("INSERT INTO {menu_stp_roles} (`mid`,`rid`) VALUES ('$form[mid]','$rid');");
break;
case 'pgsql':
db_query("INSERT INTO {menu_stp_roles} (mid,rid) VALUES ('$form[mid]','$rid');");
break;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | menu_stp.patch | 1.19 KB | dfrake |
Comments
Comment #1
ray007 commentedYeah, haven't got a single postgres installation, but I thought that would come sooner or later.
I guess it should be possible to make the second query work with both databases by dumping the back-quotes for the field specifiers.
Will try to push out a fix soon ... would be even better if you could attach this here in patch form ;-)
Comment #2
dfrake commentedNever used Patch Format before, hope this one is right...
Comment #3
ray007 commentedcommited with a few changes to cvs.
Comment #4
(not verified) commented