问题
In short, when I go into Site Setup -> Types and try and change the workflow for Images from "No Workflow" to any other workflow, I get the following error:
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module plone.app.controlpanel.types, line 165, in __call__
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module plone.app.discussion.browser.controlpanel, line 181, in notify_configuration_changed
AttributeError: 'NoneType' object has no attribute 'forInterface'
I suspect the way we setup this Plone instance caused the issue. We have a 4.0.8 install (Staging) where we did our initial site construction. We setup another 4.0.8 install for production. Ran a backup on Staging and copied the Staging backup files and blobstorage over to Production. Production worked fine; appeared to be a perfect clone of Staging.
Later, we wanted to move to 4.1.1, so we created another install on 4.1.1 and repeated the above process from Production to our new instance. After a day of testing, it appears to work. Cool, we have a 4.1.1 Production box now. Week later, users want Images to operate under the same workflow (Intranet/Extranet) as all the other content and that's when I ran into the error.
I can change the workflow through the ZMI portal_workflow tool without any apparent problems.
回答1:
Looking at the product code, It seems that when you change the contenttype's workflow the p.a.discussion product tries to update its configuration but in your instance fails to retrieve the registry.
As a fast solution you could try to force the inclusion of the registry by adding in a zcml of one of your products this code:
<include package="plone.app.registry" />
then:
1- go to zmi -> your site and check if in your plone site exists an item called "portal_registry"
2- go to zmi -> your site -> tab "Components" and check if exists this registration:
<utility interface="plone.registry.interfaces.IRegistry"
object="portal_registry" />
回答2:
Had the same problem, could solve it by importing the steps 'Manage the configuration registry' and ' Plone caching' of the profile 'Configuration registry'.
来源:https://stackoverflow.com/questions/7810648/an-error-when-trying-to-change-image-workflow