Forum OpenACS Q&A: Error deleting a xowiki page

Collapse
Posted by Nima Mazloumi on
I tried to delete an xowiki page and got the following error. any idea why? This happens if a comment was added to this page.

Database operation "0or1row" failed (exception ERROR, "FEHLER: Aktualisieren oder Löschen in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_obj_context_idx_anc_id_fk« von Tabelle »acs_object_context_index«
DETAIL: Auf Schlüssel (object_id)=(5837660) wird noch aus Tabelle »acs_object_context_index« verwiesen.
CONTEXT: SQL-Anweisung »delete from acs_objects where object_id = 5837660«
PL/pgSQL function "acs_object__delete" line 43 at execute statement
SQL-Anweisung »SELECT acs_object__delete( $1 )«
PL/pgSQL function "content_item__del" line 122 at perform
")

FEHLER: Aktualisieren oder Löschen in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_obj_context_idx_anc_id_fk« von Tabelle »acs_object_context_index«
DETAIL: Auf Schlüssel (object_id)=(5837660) wird noch aus Tabelle »acs_object_context_index« verwiesen.
CONTEXT: SQL-Anweisung »delete from acs_objects where object_id = 5837660«
PL/pgSQL function "acs_object__delete" line 43 at execute statement
SQL-Anweisung »SELECT acs_object__delete( $1 )«
PL/pgSQL function "content_item__del" line 122 at perform

SQL:
select content_item__del('5837660')

while executing
"ns_pg_bind 0or1row $db $sql"
invoked from within
"ns_set value [ns_pg_bind 0or1row $db $sql] 0 "
invoked from within
"return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]"
("uplevel" body line 3)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
#my log "sql=$sql, sql_command=ns_set value [ns_pg_bind 0or1row $db $sql] 0"
return [ ns_set value [ns_p..."
(procedure "del" line 17)
::xo::db::sql::content_item->del
invoked from within
"::xo::db::sql::content_item del -item_id $item_id"
(procedure "delete" line 4)
invoked from within
"next"
(procedure "delete" line 4)
::xowiki::Page ::Generic::CrCache->delete
invoked from within
"[my info class] delete -item_id $item_id"
(procedure "delete" line 4)
invoked from within
"next"
(procedure "delete" line 4)
::5837660 ::Generic::CrCache::Item->delete
invoked from within
"$object $method"
(procedure "call" line 7)
::5837604 ::xowiki::Package->call
invoked from within
"my call $page $method"
(procedure "invoke" line 12)
::5837604 ::xowiki::Package->invoke
invoked from within
"::$package_id invoke -method $m"
invoked from within
"::$package_id reply_to_user [::$package_id invoke -method $m]"
(file "/www/unima2_test/packages/xowiki/www/index.vuh" line 21)
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 $file"

Collapse
Posted by Gustaf Neumann on
Just to paraphrase your message: you got this error, when deleting an xowiki page, which was commented through the "General Comments" package. This was indeed incorrect. Seems as if general comments are not used often, at least not in connection with xowiki. Interesting enough, general comments has only an API for adding comments but none for deleting comments.

I have just now committed updates to the oacs-5-3 branch, which does the following:
- Adding automatically permissions to allow registered users to add general_comments (when general_comments is configured)
- Deleting automatically comments from general_comments, when a commented page is deleted (when general_comments is configured)

A similar fix will follow soon in cvs head.

-gustaf neumann

Collapse
Posted by Nima Mazloumi on
You are right. GC has no delete functionality.