When i try to activate Products.CMFPlacefulWorkflow, i got the following error :
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 686, in installProducts
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 603, in installProduct
__traceback_info__: ('CMFPlacefulWorkflow',)
Module Products.GenericSetup.tool, line 379, in runAllImportStepsFromProfile
__traceback_info__: profile-Products.CMFPlacefulWorkflow:CMFPlacefulWorkflow
Module Products.GenericSetup.tool, line 1414, in _runImportStepsFromContext
Module Products.GenericSetup.tool, line 1226, in _doRunImportStep
__traceback_info__: placeful_workflow
Module Products.CMFPlacefulWorkflow.exportimport.workflow_policies, line 143, in importWorkflowPolicies
Module Products.GenericSetup.utils, line 849, in importObjects
__traceback_info__: portal_placeful_workflow
Module Products.GenericSetup.utils, line 512, in _importBody
Module Products.GenericSetup.OFSP.exportimport, line 54, in _importNode
Module Products.GenericSetup.utils, line 571, in _initObjects
__traceback_info__: ('intranet', 'WorkflowPolicy')
Module OFS.ObjectManager, line 326, in _setObject
Module OFS.ObjectManager, line 120, in checkValidId
The file Products.CMFPlacefulWorkflow-1.5.13-py2.7.egg/Products/CMFPlacefulWorkflow/profiles/default/portal_placeful_workflow/intranet.xml seems to be the cause.
The file name of a workflow description is completely unrelated here. You know your options and do not continue searching. You can not have an object with the same ID as your site.
from zope.component import queryMultiAdapter
from Products.CMFCore.utils import getToolByName
from Products.GenericSetup.interfaces import IBody
import Products.CMFPlacefulWorkflow
def importObjects(obj, parent_path, context):
importer = queryMultiAdapter((obj, context), IBody)
path = '%s%s' % (parent_path, obj.getId().replace(' ', '_'))
__traceback_info__ = path
if importer:
if importer.name:
path = '%s%s' % (parent_path, importer.name)
filename = '%s%s' % (path, importer.suffix)
body = context.readDataFile(filename)
if body is not None:
lines = [ line for line in body.split('\n') if 'object name="intranet"' not in line ]
importer.filename = filename
importer.body = '\n'.join(lines)
if getattr(obj, 'objectValues', False):
for sub in obj.objectValues():
importObjects(sub, path + '/', context)
def importWorkflowPolicies(context):
site = context.getSite()
tool = getToolByName(site, 'portal_placeful_workflow', None)
if tool is not None:
importObjects(tool, '', context)
Products.CMFPlacefulWorkflow.exportimport.workflow_policies.importWorkflowPolicies = importWorkflowPolicies
no, you didn't find a solution… a solution must be tested and merged upstream; as Andreas told you, you're creating yourself a problem.
coming to the forum in search of advice and rejecting the advice with arrogance is not pretty clever; specially if the advice comes from a former Zope 2 release manager.
Plone is extremely complex and it can be code that relies in the assumption that no object can have the same id as the site in the acquisition chain.
that your site seems to be running doesn't mean that you're not going to be bitten by an issue later.
there is a use case for renaming Plone site and that must be easy for all users; working on the core to try to solve that issue is the right way to do it.
if you really want to help on this, clone the Plone repo, add some tests and work on a solution with the help of our framework team.
The problem is the intranet.xml file and the portal_placeful_workflow.xml file that references it: I just created a Plone Site with id intranet and then tried installing CMFPlacefulWorkflow and got the same error.
If this is just one site and you have access to the filesystem, it is probably easiest to basically do what you did in code, except do it manually:
Edit Products/CMFPlacefulWorkflow/profiles/default/portal_placeful_workflow.xml and temporarily remove the intranet line from it.
Install CMFPlacefulWorkflow. The intranet placeful workflow definition will not be installed, but the rest will work just fine.
Undo your edit.
Strangely, creating a page or folder with id intranet is allowed just fine when your Plone Site already has that id. So the name check is not done everywhere.