Plone 4.2.5: Disallowed to paste item(s) - plone

Today I upgrade plone from 4.1.4 to latest 4.2.5 through buildout. Everthing works except paste. When I paste a page to a folder, traceback shows:
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 Products.CMFFormController.FSControllerPythonScript, line 105, in __call__
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 127, in __call__
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 33, in folder_paste
- <FSControllerPythonScript at /keti/folder_paste used for /keti/switch1>
- Line 33
Exception: Disallowed to paste item(s).
I need your help.

Usually this error is thrown, if the 'allowed content types to add' are restricted, so I doubt a correlation of your problem with the upgrade and rather suspect a simple configuration-setting as the cause:
Go to
http://yourhost.org:8888/yourSiteId/portal_types/Folder/manage_propertiesForm
Look, if 'Filter content types' is checked.
If yes, either uncheck or define the allowed types in the widget below.

Ida Ebkes did get the point. So I unchecked 'Filter content types' and select file, document, folder in the widget below in portal_types/Plone%20Site/manage_propertiesForm . But it works for frontpage. So If I want "Add new" appear global, I have to check "Implicitly addable" in every content type page under portal_types.
Thanks,
Hugo

Related

Plone catalog rebuild: AttributeError portal_setup

Since a few days, I get following Error, if I rebuild the portal_catalog
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.CMFPlone.CatalogTool, line 446, in manage_catalogRebuild
Module plone.app.discussion.patches, line 47, in patchedClearFindAndRebuild
Module OFS.FindSupport, line 239, in ZopeFindAndApply
Module OFS.FindSupport, line 198, in ZopeFindAndApply
Module Products.ZCatalog.Lazy, line 190, in __getitem__
Module plone.folder.ordered, line 94, in <lambda>
Module plone.folder.ordered, line 59, in _getOb
AttributeError: 'portal_setup'
Has anyone an Idea, what could be wrong?
Plone 4.3.4
The old language root folder implementation left garbage ids in the IOrdering of the folder. This needs a manual cleanup. An example here https://gist.github.com/jensens/356ab35614c4c0a7c626d8ba4a7a8479 - you may need to append values to the blacklist, depending on language and addons installed.

Upgrade Plone 3.3.6 to either Plone 4.3.7 or Plone 5 (Error: 'tuple' object has no attribute 'remove')

I'm attempting an upgrade of an existing site from Plone 3.3.6 to Plone 4.3.7, and then on to Plone 5.0.
The existing site is very small, and has no add-on Products installed (vanilla Plone, vanilla template, etc.) It did have CacheFu installed, but after some earlier obvious errors with that, I removed it prior to the upgrade. I'm simply copying the contents of var/filestorage (Data.fs, etc) from v3 site to v4 site and re-running buildout.
In Plone 4.3.7, when running the UPGRADE option, I see a lot of successful activity, and then the following error at the bottom:
Upgrade aborted. Error:
Traceback (most recent call last):
File "/usr/local/Plone4_migration/buildout-cache/eggs/Products.CMFPlone-4.3.7-py2.7.egg/Products/CMFPlone/MigrationTool.py", line 259, in upgrade
step['step'].doStep(setup)
File "/usr/local/Plone4_migration/buildout-cache/eggs/Products.GenericSetup-1.7.7-py2.7.egg/Products/GenericSetup/upgrade.py", line 160, in doStep
self.handler(tool)
File "/usr/local/Plone4_migration/buildout-cache/eggs/plone.app.upgrade-1.3.18-py2.7.egg/plone/app/upgrade/v40/betas.py", line 99, in beta3_beta4
value.remove('Large Plone Folder')
AttributeError: 'tuple' object has no attribute 'remove'
If I skip Plone 4.x and jump right to Plone 5.0, I can't even run the UPGRADE feature, and just get the following error trace on the console:
2015-10-09 01:14:21 ERROR Zope.SiteErrorLog 1444371261.060.792132208718 http://www.example.com/example
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.BaseRequest, line 444, in traverse
Module ZPublisher.BeforeTraverse, line 97, in __call__
Module Products.CMFCore.PortalObject, line 75, in __before_publishing_traverse__
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 zope.component.event, line 32, in objectEventNotify
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.theming.plugins.hooks, line 33, in onRequest
Module plone.app.theming.policy, line 90, in isThemeEnabled
AttributeError: 'NoneType' object has no attribute 'enabled'
This is a known bug which has a fix that was not released yet: https://github.com/plone/Products.CMFPlone/issues/1134

Can't create Dexterity content type programatically in Plone 4.3.1

I created a new content type using the Dexterity manager in Site Setup. I'm able to successfully add content through the Plone user interface, but I've come to a point where I need to create the same object with a python script.
My first attempt was with invokeFactory:
context.invokeFactory("mycontenttype", id="test", Title="Test")
This same code works for "Folder" objects, but fails with my Dexterity type:
Traceback (innermost last):
Module ZPublisher.Publish, line 60, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Products.PloneHotfix20130618.spamProtect, line 35, in _patched_bindAndExec
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 7, in test
- <PythonScript at /three-year-plan/test>
- Line 7
TypeError: invokeFactory() takes at least 3 arguments (2 given)
After doing some more searching, I found several places referring to the following function:
from plone.dexterity.utils import createContentInContainer
Any attempt to import from plone.dexterity.utils in my python scripts ends up with a permissions error:
Traceback (innermost last):
Module ZPublisher.Publish, line 60, in publish
Module ZPublisher.mapply, line 77, in mapply
zModule ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Products.PloneHotfix20130618.spamProtect, line 35, in _patched_bindAndExec
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 1, in test
- <PythonScript at /my-site/test>
- Line 1
Module AccessControl.ZopeGuards, line 305, in guarded_import
Unauthorized: import of 'plone.dexterity.utils' is unauthorized
Any help in resolving the errors above or alternative methods would be greatly appreciated. Version details are posted below for reference.
Version Overview
Plone 4.3.1 (4306)
CMF 2.2.7
Zope 2.13.19
Python 2.7.3 (default, Aug 1 2012, 05:14:39) [GCC 4.6.3]
PIL 1.7.8 (Pillow)
Dexterity Content Types 2.0.8
You should be able to use "invokeFactory" for this purpose. You call it on the container and pass it the type name as a string.
I'm not sure where your attempt to use the invokeFactory method went awry, but it does work. See http://developer.plone.org/reference_manuals/external/plone.app.dexterity/reference/manipulating-content-objects.html?highlight=invokefactory#adding-an-object-to-a-container for details.
Your guess is right: you have to use createContentInContainer.
But you cannot use it in a Python script because only the so called restricted Python is allowed [1]. Put it in a view [2].
As a reference have a look to:
http://developer.plone.org/reference_manuals/active/helloworld/extend/view.html
http://plone.org/documentation/faq/restricted-python-scripts

Aliases tab in portal_types tool in ZMI

I was trying to debug an unrelated issue with my site when I noticed the Aliases tab in the portal_types tool in the ZMI. I get no response if I try to access it in my Plone 4.1.5 site which uses dexterity. The following error is logged:
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 Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PageTemplates.PageTemplateFile, line 130, in _exec
Module Products.PageTemplates.PageTemplate, line 79, in pt_render
Module zope.pagetemplate.pagetemplate, line 126, in pt_render
- Warning: Compilation failed
- Warning: exceptions.SyntaxError: invalid syntax (4c47ca874ec06dbf9207ed3a51ff9bb29425ee06.py, line 4)
PTRuntimeError: ['Compilation failed', 'exceptions.SyntaxError: invalid syntax (4c47ca874ec06dbf9207ed3a51ff9bb29425ee06.py, line 4)']
It is working for a separate Plone 3.3.6 site I look after.
Is this view still supported in Plone 4.1?
As vangeem says this is a Chameleon issue
https://github.com/malthe/chameleon/issues/114

Cannot change the Type Settings in Site Setup

I am trying to change the Type Settings in Site Setup. The default is Simple Publication Workflow. When I tried to change it to Intranet Workflow or Community Workflow or any other workflow, I got this 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 23, 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 583, in subscribers
Module plone.app.discussion.browser.controlpanel, line 181, in notify_configuration_changed
AttributeError: 'NoneType' object has no attribute 'forInterface'
Can anybody advise?
We are using plone 4.1
Thank you very much.
Cmgui

Resources