Forum OpenACS Development: Re: Subsite package keys: 'acs-subsite' vs. 'dotlrn' ?

Collapse
Posted by Ola Hansson on
I think I will stick with the older of the two procs for now as I don't get the new one to work with a package_key of "acs_subsite" (it returns "") when .LRN is installed.

(I've reported that bug here: https://openacs.org/bugtracker/openacs/bug?bug%5fnumber=580)

Besides changing "site_node_closest_ancestor_package" to iterate a list of package_keys, the code I'm writing will have to check whether .LRN is installed or not, and if it is pass the "dotlrn" key in addition to "acs-subsite" (which the list will always contain). If I don't do that check but instead hard code the two keys, and dotlrn's not installed, things go south since the system doesn't recognize the key "dotlrn"...

Also, the list must look like this: [list dotlrn acs-subsite], i.e., "dotlrn" as the first element, otherwise it will detect the main subsite before it detects the dotlrn instance the curriculum is under.

So, If you agree that I should check for the existence of .LRN, then another known problem arises, namely that of checking if a package is installed. I brought this up before in this thread: https://openacs.org/forums/message-view?message_id=105027

The use of "apm_package_installed_p" was suggested, but since it is being cached the answer from that proc is not entirely reliable; the server will need a restart if a package has been uninstalled...

Do you have any thoughts on how to proceed?