Index: openacs-4/packages/acs-core-docs/www/tutorial-categories.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-categories.adp,v diff -u -r1.4.2.4 -r1.4.2.5 --- openacs-4/packages/acs-core-docs/www/tutorial-categories.adp 5 Jan 2021 17:33:40 -0000 1.4.2.4 +++ openacs-4/packages/acs-core-docs/www/tutorial-categories.adp 8 Apr 2021 15:44:06 -0000 1.4.2.5 @@ -70,10 +70,8 @@ } -new_data { .... category::map_object -remove_old -object_id $item_id $category_ids - db_dml insert_asc_named_object "insert into acs_named_objects (object_id, object_name, package_id) values ( :item_id, :title, :package_id)" } -edit_data { .... - db_dml update_asc_named_object "update acs_named_objects set object_name = :title, package_id = :package_id where object_id = :item_id" category::map_object -remove_old -object_id $item_id $category_ids } -after_submit { ad_returnredirect "." @@ -82,13 +80,7 @@

While the category::ad_form::add_widgets proc is taking care to extend your form with associated categories you need to ensure that your items are mapped to the corresponding category -object yourself. Also since the categories package knows nothing -from your objects you have to keep the acs_named_objects table updated with any -changes taking place. We use the items title so that they are -listed in the categories browser by title.

Make sure that you also delete these entries if your item is -delete. Add this to your corresponding delete page:

-                        db_dml delete_named_object "delete from acs_named_objects where object_id = :item_id"
-                        

+object yourself.

note-edit.tcl requires a note_id to determine which record should be deleted. It also looks for a confirmation @@ -204,11 +196,8 @@ if { $use_categories_p == 1 && $category_id ne "" } { - set from_clause "category_object_map com, acs_named_objects ano" - set_where_clause "com.object_id = qa.entry_id and - ano.package_id = :package_id and - com.object_id = ano.object_id and - com.category_id = :category_id" + set from_clause "category_object_map com" + set_where_clause "com.object_id = qa.entry_id and com.category_id = :category_id" ...