Forum .LRN Q&A: Permissions on Postgresql version of Forums

There was a bug in the postgresql version of forums where context_id
was not getting set so that registered users could not view messages.
Has this been fixed?
Collapse
Posted by Dave Bauer on

I have tracked down the context_id error in the postgresql version of forums, i think.

The pl/pgsql function forum_message__new takes context_id as an argument and uses that to set the context_id of the acs_object for the forums_message object. The oracle version of the function uses nvl(p_context_id, p_forum_id) so that if no context_id is passed, the forum_id is used.

I tried to copy this in postgresql using coalesce(p_context_id, p_forum_id) and it does the the context_id correctly.

The problem arises when

perform acs_object__update_last_modified(p_forum_id);
is called. This error occurs:
ERROR:  triggered data change violation on relation "acs_object_co
ntext_index"

Any ideas on how to fix this? Switch to postgresql 7.2?

I noticed the context_id problem a few weeks ago.  Have you made any more progress identifying a fix for it? (This is what has been causing the permissions problems with forums I've been posting about for the past couple of months.)
Collapse
Posted by Dave Bauer on
Benjamin,

The fix I describe will work with postgresql 7.2. In forums_meesage__new change in the call to acs_object__new where it says p_context_id to
coalesce(p_context_id, p_forum_id)

The data change violation is caused by a bug in postgresql 7.1.

Has the fix been committed to CVS?
Collapse
Posted by Dave Bauer on
Benjamin,

I am waiting for feedback from the designers of the forums package regarding this fix.

I haven't been able to test it, but it is an exact port of the behavior of the oracle version of the code.

Collapse
Posted by Arjun Sanyal on
dave: it's checked in and, by the way, forums_forum__new had the same issue.
This is great news.  I've been waiting for this fix for a while now.  Now I have no excuse to put off getting started on that new website...