Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 16 Apr 2002 05:17:17 -0000 1.41 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 16 Apr 2002 13:57:07 -0000 1.42 @@ -96,13 +96,6 @@ } { Add the calendar applet to a specific dotlrn community } { - # set up a nice name for the comm's calendar - set cal_name "[dotlrn_community::get_community_name $community_id] Public Calendar" - - # create the community's calendar, the "f" is for a public calendar - set group_calendar_id \ - [calendar_create [ad_conn "user_id"] "f" $cal_name] - # add this element to the portal template. # do this directly, don't use calendar_portlet::add_self_to_page here set portal_template_id \ @@ -117,9 +110,6 @@ $portal_template_id \ [calendar_portlet::my_name]] - # set the group_calendar_id parameter in the portal template, - portal::set_element_param \ - $element_id "calendar_id" $group_calendar_id # add the "full calendar" portlet to the commnuity's "calendar" page, # similar to the same thing on a user's wsp. use the get_user_def_page @@ -129,6 +119,29 @@ -page_name [get_user_default_page] \ ] + + if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { + # since this is a dummy comm, set a fake g_cal_id + set element_id [calendar_full_portlet::add_self_to_page \ + -page_id $page_id \ + $portal_template_id \ + 0 + ] + + return + } + + # set up a nice name for the comm's calendar + set cal_name "[dotlrn_community::get_community_name $community_id] Public Calendar" + + # create the community's calendar, the "f" is for a public calendar + set group_calendar_id \ + [calendar_create [ad_conn "user_id"] "f" $cal_name] + + # set the group_calendar_id parameter in the portal template, + portal::set_element_param \ + $element_id "calendar_id" $group_calendar_id + set element_id [calendar_full_portlet::add_self_to_page \ -page_id $page_id \ $portal_template_id \