Forum .LRN Q&A: problems in subject/class and club-new on postgres

Again on dotlrn on postgres, fressh install from CVS

The /dotlrn/admin/classes doesn't have a "create a class" is it
because I was not able to create a department?

it also crashes on /dotlrn/admin/club-new

This is a patch that I sent in that might help.  It prevented me from adding classes during migration.

File: packages/dotlrn/tcl/community-procs.tcl

Proc: new

Change the following:

      set template_id [dotlrn::get_portal_id_from_type -type $community_type]

To:

      set template_id [dotlrn::get_portal_id_from_type -type $object_type]

Reasoning:

At this point, community_type is the class key and the object_type is one of dotlrn_community, dotlrn_class_instance or dotlrn_club.  If you use community_type, there is no matching row in dotlrn_portal_types_map and therefore no template id.

I discovered this because, after the addition of the static_portlet stuff, I was no longer able to add classes.  This code relied on the template_id to get required information.

I believe this bug would also cause the class template not to be used.

Tracy

You don't have to patch the dotlrn sources now. In the CVS HEAD, creating all types of communities should work fine, but if it doesn't let us know!

We accidentally introduced a bug here on the 22nd, but then fixed it on the 24th. Tracy, your fix does the right thing to workaround the bug, but was only necessary while the bug (in dotlrn::get_portal_id_from_type) in was alive.

We might incorporate your fix into dotlrn when we run
though this code again since it makes type issues a bit
more explicit.

Arjun, I jsut updated from CVS. create community stll has a bug:
Selection did not return a value, and no default was provided
           while executing
       "db_string select_node_id {}"
           (procedure "get_type_node_id" line 2)
           invoked from within
       "get_type_node_id $community_type"
           invoked from within
       "if {[empty_string_p $parent_community_id]} {
                       set parent_node_id [get_type_node_id $community_type]
                   } else {
                     ..."
           ("uplevel" body line 33)
           invoked from within
       "uplevel 1 $transaction_code "
           (procedure "db_transaction" line 1)
           invoked from within
       "db_transaction {
                   set user_id [ad_conn user_id]
                   set community_id [package_instantiate_object -extra_vars $extra_vars $object_ty..."
           (procedure "dotlrn_community::new" line 25)
           invoked from within
       "dotlrn_community::new  -community_type [community_type]  -object_type [community_type]  -pretty_name $pretty_name  -description $description  -parent_..."
           (procedure "dotlrn_club::new" line 6)
           invoked from within
       "dotlrn_club::new  -description $description  -pretty_name $pretty_name  -join_policy $join_policy"
           invoked from within
       "if {[form is_valid add_club]} {
           form get_values add_club  pretty_name description join_policy referer