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"
...
Index: openacs-4/packages/acs-core-docs/www/tutorial-categories.html
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-categories.html,v
diff -u -r1.17.2.2 -r1.17.2.3
--- openacs-4/packages/acs-core-docs/www/tutorial-categories.html 29 Nov 2019 14:28:48 -0000 1.17.2.2
+++ openacs-4/packages/acs-core-docs/www/tutorial-categories.html 8 Apr 2021 15:44:06 -0000 1.17.2.3
@@ -72,24 +72,16 @@
} -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 "."
ad_script_abort
}
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" -
note-edit.tcl
requires a
+ to the corresponding category object yourself.
note-edit.tcl
requires a
note_id
to determine which record
should be deleted. It also looks for a confirmation variable, which
should initially be absert. If it is absent, we create a form to
@@ -199,11 +191,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 category_id = :category_id"
...
Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml,v
diff -u -r1.60.2.7 -r1.60.2.8
--- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 6 Aug 2020 13:23:35 -0000 1.60.2.7
+++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 8 Apr 2021 15:44:06 -0000 1.60.2.8
@@ -557,10 +557,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 "."
@@ -569,14 +567,7 @@