[Zope-CMF] Re: purging of actions in CMF 1.6

Florent Guillaume fg at nuxeo.com
Thu Jan 19 14:11:13 EST 2006


Rob Miller wrote:
> 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?

Ok so it's just a bug :)
I'll fix the code as I need it urgently working.

And I'll remove any hardcoded default actions from any tool I find, these 
actions should be in the profiles only.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-CMF mailing list