Forum OpenACS Q&A: Classified Ads Module Broken

Collapse
Posted by James Thornton on
The classified ads module appears to be broken in the current version of OpenACS 3.2.5 -- it won't let you add a new domain. It looks like creation_user is not being passed somewhere...
[07/Nov/2001:19:15:10][21990.4101][-conn0-] Notice: Querying 'select 
ad_group_member_p(1, system_administrator_group_id()) from dual;'
[07/Nov/2001:19:15:10][21990.4101][-conn0-] Notice: dbinit: sql
(localhost:5433:buxs): 'select ad_group_member_p(1, 
system_administrator_group_id()) from dual'
[07/Nov/2001:19:15:10][21990.4101][-conn0-] Notice: ns_getform using 
encoding iso8859-1 for charset iso-8859-1
[07/Nov/2001:19:15:10][21990.4101][-conn0-] Error: Ns_PgExec: result 
status: 7 message: ERROR:  ExecAppend: Fail to add null value in not 
null attribute creation_user

[07/Nov/2001:19:15:10][21990.4101][-conn0-] Error: dbinit: error
(localhost:5433:buxs,ERROR:  ExecAppend: Fail to add null value in 
not null attribute creation_user
): 'select administration_group_add('Admin group for the misc 
classifieds', short_name_from_group_name('Admin group for the misc 
classifieds'), 'gc', 'misc', 'f', '/gc/admin/domain-top.tcl?
domain=misc')'
[07/Nov/2001:19:15:10][21990.4101][-conn0-] Error: Database 
operation "select" failed (exception NSDB, "Query was not a statement 
returning rows.")
Database operation "select" failed (exception NSDB, "Query was not a 
statement returning rows.")
    while executing
"ns_db select $db "select administration_group_add('Admin group for 
the $QQdomain classifieds', short_name_from_group_name('Admin group 
for the $QQdoma..."
    (file "/web/buxs/www/admin/gc/domain-add-2.tcl" line 45)
    invoked from within
"source $script"
    (procedure "ns_sourceproc" line 6)
    invoked from within
"ns_sourceproc cns22 {}"
Collapse
Posted by James Thornton on
I found the problem -- I had changed the system account's e-mail address from "system" to my e-mail address. The function administration_group_add() calls system_user_id(), and it trys to set creation_user to the returned value.

Here's part of the code from system_user_id()...

begin
  select user_id into v_user_id from users where email = 'system';
  return v_user_id;
end;

Since there wasn't an e-mail address called "system", the function returned no value; thus, no value was being passed for creation_user in the insert into user_groups statement in administration_group_add().