[Zope-CMF] Re: purging of actions in CMF 1.6
Rob Miller
ra at burningman.com
Thu Jan 19 13:34:13 EST 2006
Florent Guillaume wrote:
> It seems that an extension profile can't add actions to an action
> provide in CMF 1.6. Or, rather, if you do it all previous actions are
> erased.
>
> The actions exportimport code has:
>
> def _initProviders(self, node):
> ...
> # delete any actions that are auto-created
> provider = getToolByName(self.context, provider_id)
> num_actions = len(provider.listActions())
> if num_actions:
> provider.deleteActions(range(0,num_actions))
>
> What is this for? It's harmful.
ah, whoops. this is mine. it's meant to work around the fact that the
tools have their action sets hard-coded when they are instantiated; if
this is not there, the actions would be duplicated when the actions are
loaded from the setup profile.
> Also, it seems actions inside action providers aren't purged correctly.
the code above is an attempt to do just that.
> Can someone shed light on what the code tries to do? Can I use
> "newstyle" action profiles in CMF 1.6?
that's the idea. i just didn't account for extension profiles when i
wrote the action purging code. does it make sense to skip the action
purge when it is an extension profile being run? or is there a more
sensible way to handle this?
-r
More information about the Zope-CMF
mailing list