Forum OpenACS Development: Re: Getting package_id in an init.tcl script

Posted by Janine Ohmer on
Finally getting back to this...

The after_mount callback does work if I mount a new instance of bulk-mail from the site-map.  But it does not happen when the site starts/restarts.  There must be some other mechanism other than site_node::mount mounting up the packages during site startup.  Can anyone point me in the right direction?

Posted by Randy O'Meara on
Once a package is mounted it's always mounted.

As Don said, if you're trying to retrofit existing bulk-mail instances with attachments, an *-init.tcl file that searches the site-map for existing bulk-mail (without attachments child node) and instantiates attachments would work. You should only have to do this once to hit every existing bulk-mail node.

If you add code to the bulk-mail after-mount callback to instantiate attachments, each new (mounted) bulk-mail instance would automatically get attachments.

Procs that may be useful: