Index: openacs-4/packages/faq/faq.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/faq.info,v diff -u -N -r1.36 -r1.37 --- openacs-4/packages/faq/faq.info 29 Jan 2019 17:10:34 -0000 1.36 +++ openacs-4/packages/faq/faq.info 30 Jan 2019 11:59:49 -0000 1.37 @@ -7,7 +7,7 @@ f f - + Nima Mazloumi Jennie Kim Housman Elizabeth Wirth @@ -18,7 +18,7 @@ 2 #faq.FAQs# - + @@ -28,7 +28,6 @@ - Index: openacs-4/packages/faq/sql/postgresql/faq-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/sql/postgresql/faq-sc-create.sql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/faq/sql/postgresql/faq-sc-create.sql 15 Aug 2018 16:55:08 -0000 1.4 +++ openacs-4/packages/faq/sql/postgresql/faq-sc-create.sql 30 Jan 2019 11:59:49 -0000 1.5 @@ -31,5 +31,24 @@ $$ language plpgsql; create trigger faq_sc__itrg after insert on faq_q_and_as for each row execute procedure faq_sc__itrg (); -create trigger faq_sc__dtrg after delete on faq_q_and_as for each row execute procedure faq_sc__dtrg (); +-- apisano 2019-01-30: intended purpose of this trigger is to schedule +-- deletion of faq content from the search package engine indexes by +-- calling search_observer__enqueue(entry_id, 'DELETE') on the just +-- deleted entry. However, as this entry depends on the corresponding +-- q_and_a acs_object, either we keep this object hanging around until +-- the unindexing happens, or we just delete this as well (e.g. this +-- happens in faq__delete_q_and_a stored procedure): +-- -- delete from faq_q_and_as where entry_id = p_entry_id; +-- -- raise NOTICE 'Deleting FAQ_Q_and_A...'; +-- -- PERFORM acs_object__delete(p_entry_id); +-- Deleting the object brings the entry in the search queue to be +-- deleted as well via on delete cascade, de-facto preventing this +-- tuple from being used at all in the scheduled search indexer. +-- Furthermore, unindexing will take place anyway via on delete +-- cascate defined on txt.object_id for tsearch2-driver and apparently +-- also on site_wide_index.object_id for the intermedia-driver on +-- Oracle, making all this trigger daydream quite pointless. To make +-- things worse, this trigger complicates removal of a faq instance, +-- as long as faqs with entries are there. +-- create trigger faq_sc__dtrg after delete on faq_q_and_as for each row execute procedure faq_sc__dtrg (); create trigger faq_sc__utrg after update on faq_q_and_as for each row execute procedure faq_sc__utrg (); Index: openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-5.10.0d6-5.10.0d7.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-5.10.0d6-5.10.0d7.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-5.10.0d6-5.10.0d7.sql 30 Jan 2019 11:59:49 -0000 1.1 @@ -0,0 +1,24 @@ +begin; + +-- apisano 2019-01-30: intended purpose of this trigger is to schedule +-- deletion of faq content from the search package engine indexes by +-- calling search_observer__enqueue(entry_id, 'DELETE') on the just +-- deleted entry. However, as this entry depends on the corresponding +-- q_and_a acs_object, either we keep this object hanging around until +-- the unindexing happens, or we just delete this as well (e.g. this +-- happens in faq__delete_q_and_a stored procedure): +-- -- delete from faq_q_and_as where entry_id = p_entry_id; +-- -- raise NOTICE 'Deleting FAQ_Q_and_A...'; +-- -- PERFORM acs_object__delete(p_entry_id); +-- Deleting the object brings the entry in the search queue to be +-- deleted as well via on delete cascade, de-facto preventing this +-- tuple from being used at all in the scheduled search indexer. +-- Furthermore, unindexing will take place anyway via on delete +-- cascate defined on txt.object_id for tsearch2-driver and apparently +-- also on site_wide_index.object_id for the intermedia-driver on +-- Oracle, making all this trigger daydream quite pointless. To make +-- things worse, this trigger complicates removal of a faq instance, +-- as long as faqs with entries are there. +drop trigger faq_sc__dtrg on faq_q_and_as; + +end; Index: openacs-4/packages/faq/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/tcl/apm-callback-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/faq/tcl/apm-callback-procs.tcl 18 Jan 2019 19:33:17 -0000 1.5 +++ openacs-4/packages/faq/tcl/apm-callback-procs.tcl 30 Jan 2019 11:59:49 -0000 1.6 @@ -55,20 +55,6 @@ } } -ad_proc -private faq::apm_callback::before_uninstantiate { - -package_id -} { - Callback to remove all FAQs before package uninstantiate - - @author Héctor Romojaro - @creation-date 2019-01-18 -} { - db_multirow faqs faq_list "" {} - template::multirow foreach faqs { - db_exec_plsql _ "select faq__delete_faq(:faq_id)" - } -} - ad_proc -public faq::apm_callback::delete_one_faq_impl {} { Unregister the NotificationType implementation for one_faq_qa_notif_type. } { Index: openacs-4/packages/faq/tcl/apm-callback-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/tcl/Attic/apm-callback-procs.xql,v diff -u -N --- openacs-4/packages/faq/tcl/apm-callback-procs.xql 18 Jan 2019 19:33:17 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ - - - - - - select faq_id - from acs_objects o, - faqs f - where object_id = faq_id - and context_id = :package_id - - - -