Forum .LRN Q&A: Re: RFC: things to improve themes package (theme-selva)

Posted by Victor Guerra on
Emma commented too about it!.

I fix this before the next meeting.
Ill let you know when its fixed.

Victor Guerra.

Hi Victor,

Finally I found what caused the error and fixed it. In the case when communities admin are allowed to change their site template, there was a recursive call between dotlrn_community::get_site_template_id_not_cached and dotlrn_community::get_site_template_id.

Here is the change I comitted for get_site_template_id_not_cached:

Index: community-procs.tcl
RCS file: /cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v
retrieving revision
retrieving revision
diff -u -r1.191.2.23 -r1.191.2.24
--- community-procs.tcl 3 Feb 2006 18:00:38 -0000
+++ community-procs.tcl 4 Mar 2006 19:56:47 -0000
@@ -2377,7 +2377,7 @@
        set dotlrn_package_id [dotlrn::get_package_id]
        set comm_site_template_id [db_string select_site_template_id {} -default "0"]
        if {[parameter::get -package_id $dotlrn_package_id -parameter AdminChangeSiteTemplate_p]} {
-           set site_template_id [get_site_template_id -community_id $community_id]
+               set site_template_id $comm_site_template_id
        } else {
            set site_template_id [parameter::get -package_id $dotlrn_package_id -parameter CommDefaultSiteTemplate_p]
            if {$site_template_id != $comm_site_template_id} {
Thanks Emma.

There was a problem with flushing the dotlrn*::get_site_template_id_not_cached *. I commited this fixes
last night. Now changing the defautl site template
from the dotlrn admin section works great for users
and communities.

And then the problem you mention with the recursive call to
get_site_template_id from get_site_template_id_not_cached.

Another thing related to this.
When you install the theme-selva package, it modifies
the 'DefaultMaster' parameter in the Main Subsite.
This brakes the changing site templates functionality.
My sugestion is to modify the install process of
selva in order to add it as a site template ( just like
Kelp and Sloan site templates , but we can talk about this
in the dotlrn chat meeting :).

Victor Guerra.

Hi Victor:

Thank you for fixing this.

About Selva, I've got it on my todo. I was waiting for the fix of site template to do it ;).

See you tonight.


Support for site-template has been added to Theme-selva package and comitted to the repository in the oacs-5-2 branch. I provided upgrade scripts also and support for both postgresql and oracle.