We want to reset the Effective Date of some Dexterity Types, which are derived from NewsItems, as we often use the Effective Date as sort criterum.
We used to have python scipts for that, which worked fine in our PLONE 4 Instanzes but don't work in our PLONE 5 sites.
In one case it looks like this and should set the Eff.Date to the Creation Date:
dateString = dateorg.strftime('%Y/%m/%d %T')
date = context.CreationDate()
oldeff = context.EffectiveDate()
neweff = context.EffectiveDate()
return "Date now %s. Creat = %s . New Eff = %s . Old Eff = %s ." % (dateString,date,neweff,oldeff )
The output of the script shows the old and the new Eff.Date as expected, but when I edit the context object in PLONE it still shows the old Eff.Date. That means, even if context.EffectiveDate() gives the new Date after having it changed, it does not store that in the object itself.
Under PLONE 4 it works as expected.
PLONE 5 Docus tell me that setEffectiveDate(date) still should work as before.
Any hints, were that problem is? Did I miss something?