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;
  }
CommentFileSizeAuthor
#2 menu_stp.patch1.19 KBdfrake

Comments

ray007’s picture

Yeah, 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 ;-)

dfrake’s picture

StatusFileSize
new1.19 KB

Never used Patch Format before, hope this one is right...

ray007’s picture

Status: Active » Fixed

commited with a few changes to cvs.

Anonymous’s picture

Status: Fixed » Closed (fixed)