The "if" function in the PostgreSQL setup throws an error when using the forum module and a user that is not the admin posts a comment.

CREATE FUNCTION "if"(integer, text, text) RETURNS text AS '
BEGIN
  IF $1 THEN
    RETURN $2;
  END IF;
  IF NOT $1 THEN
    RETURN $3;
  END IF;
END;
' LANGUAGE 'plpgsql';

should be changed to

CREATE FUNCTION "if"(integer, text, text) RETURNS text AS '
BEGIN
  IF $1 != 0 THEN
    RETURN $2;
  END IF;
  IF NOT $1 != 0 THEN
    RETURN $3;
  END IF;
END;
' LANGUAGE 'plpgsql';

for the forum module to work. I do not know if this will affect any other module, I have not noticed any difference as of yet.

Comments

Anonymous’s picture