Forum OpenACS Development: Re: callback API

Collapse
3: Re: callback API (response to 1)
Posted by Jim Lynch on
https://openacs.org/api-doc/proc-view?proc=callback&source_p=1&version_id=

Take a look at the above link. It should show the code for "callback", and I noticed a coupla places where it throws an error.

Refer to the similar link for the openacs instance in question in case (1) the code was changed in either place, or (2) the versions differ.

Collapse
4: Re: callback API (response to 3)
Posted by Iuri Sampaio on
Jim, yes i see them as well. The error was none of those.
The complete stack trace of the error is right bellow

I have wrote ns_logs in the entire API to track down what is causing it. However i have not found yet.

Furthermore in the page that calls the callback i have:

ns_log Notice "**** Before callback "

callback contact::special_attributes::ad_form_save -party_id $organization_party_id -form "party_ae"

ns_log Notice "**** after callback "

[09/Feb/2010:21:11:18][2297.3008273328][-default:0-] Notice: Inside else lsearch!
[09/Feb/2010:21:11:18][2297.3008273328][-default:0-] Notice: AFTER QRY
[09/Feb/2010:21:11:18][2297.3008273328][-default:0-] Notice: END API
[09/Feb/2010:21:11:18][2297.3008273328][-default:0-] Error: Ns_PgExec: result status: 7 message: ERROR: insert or update on table "user_preferences" violates foreign key constraint "user_preferences_user_id_fk"
DETAIL: Key (user_id)=(2491) is not present in table "users".

[09/Feb/2010:21:11:18][2297.3008273328][-default:0-] Warning: /contacts/add/organization has no doc(title) set.
[09/Feb/2010:21:11:18][2297.3008273328][-default:0-] Error: POST http://192.168.1.15/contacts/add/organization?
referred by "http://192.168.1.15/contacts/add/organization?object%5fid%5ftwo=&group%5fids=2198+%2d2&object%5ftype=organization&role%5ftwo=";
Database operation "dml" failed
(exception ERROR, "ERROR: insert or update on table "user_preferences" violates foreign key constraint "user_preferences_user_id_fk"
DETAIL: Key (user_id)=(2491) is not present in table "users".
")

while executing
"ns_pg_bind dml nsdb0 {
insert into user_preferences (user_id, locale)
select :party_id as user_id, :locale as locale
from dual..."
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
invoked from within
"db_exec dml $db $full_statement_name $sql"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
db_exec dml $db $full_statement_name $sql
}"
(procedure "db_dml" line 100)
invoked from within
"db_dml insert_preference {
insert into user_preferences (user_id, locale)
select :party_id as user_id, :locale as locale
from ..."
(procedure "::callback::contact::special_attributes::ad_form_save::impl:..." line 18)
invoked from within
"::callback::contact::special_attributes::ad_form_save::impl::contacts_locale -party_id 2491 -form party_ae"
("uplevel" body line 1)
invoked from within
"::uplevel 1 $procname $args"
invoked from within
"callback contact::special_attributes::ad_form_save -party_id $organization_party_id -form "party_ae""
("foreach" body line 74)
invoked from within
"foreach object_type $object_types {
if { $object_type eq "person" } {

if { ![exists_and_not_null url] } {
set url ""
}

# Initiali..."
("uplevel" body line 13)
invoked from within
"uplevel #$level $new_data"
(procedure "ad_form" line 626)
invoked from within
"ad_form -extend -name party_ae -export {return_url} -on_request {

if { $object_type eq "person" } {
set required_attributes [list first_names ..."
("uplevel" body line 174)
invoked from within
"uplevel {
ad_page_contract {

@author Matthew Geddert mailto:openacs@geddert.com
@creation-date 2004-07-28
@cvs-id $Id: contact-add.tcl,v 1.57 20..."
(procedure "code::tcl::/usr/local/aolserver/servers/openacs/packages/con..." line 2)
invoked from within
"code::tcl::$__adp_stub"
("uplevel" body line 12)
invoked from within
"uplevel {

if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init t..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare"
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 6)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file $path"
(procedure "rp_internal_redirect" line 26)
invoked from within
"rp_internal_redirect contact-add"
("add/organization" arm line 5)
invoked from within
"switch $file_url {
"add/person" {
if { ![ns_queryexists object_type] } {
rp_form_put object_type "person"
..."
invoked from within
"if { $party_is_contact_p } {
contact::require_visiblity -party_id $party_id

if { [llength $file_list] == "1" } {
# we..."
(file "/usr/local/aolserver/servers/openacs/packages/contacts/www/index.vuh" line 24)
invoked from within
"source [ad_conn file]"
(procedure "rp_handle_tcl_request" line 3)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file -noredirect -nodirectory -extension_pattern ".vuh" "$root$prefix""
("uplevel" body line 3)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
ad_conn -set path_info [string range [ad_conn extra_url] [expr {[string length $prefix] - 1}] end]
rp_serve_..."