Hi,

I post the solution for a mysterious portal_factory error here (don't know any 
other decent forum). This error has bugged me twice very hard so I assume other 
users might encounter it. I hope this messages serves as a memo for myself and 
other users when they are trying desperately google the solution for the 
problem next time.

Steps to reproduce:

1. You have created a user with a local role to a folder which is nested in 
another folder

2. The user can add content to the folder

3. But if the creation form validation fails when adding the content the 
following error is risen instead of displaying the creation form again

Rationale:

In Plone, portal_factory assumes you have a view + access permissions from the 
site root down to the folder where you are trying to add content. If you are 
using local roles this is not always the case - you might have folders among 
the breadcrumbs where the local user lacks the view permission. In these cases 
the error is risen if the creation form validation fails. It does not affect if 
there are no validation errors. I am not sure how this error relates to 
versioning and other  content edit hooks.

It's a bit confusing because the error says "Unable to find" instead of 
"Unauthorized".

Workaround:

Add view + access permissions to all items along the breadcrumbs for 
authenticated members. This might not be optimal or possible solution in all 
cases, but I didn't find other workarounds.

Traceback:

Traceback (innermost last): 
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFPlone.FactoryTool, line 376, in __call__
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.CMFFormController.FSControllerPageTemplate, line 90, in __call__
Module Products.CMFFormController.BaseControllerPageTemplate, line 28, in _call
Module Products.CMFFormController.ControllerBase, line 231, in getNext
Module Products.CMFFormController.Actions.TraverseToAction, line 80, in __call__
Module Products.CMFFormController.Actions.TraverseTo, line 35, in __call__
ValueError: Unable to find 
/my_folder/my_subfolder/portal_factory/MyContentType/mycontenttype.2009-04-14.8306352217/base_edit
-- 
View this message in context: 
http://n2.nabble.com/Solved%3A-ValueError%3A-Unable-to-find--my_folder-my_subfolder-portal_factory-MyContentType-mycontenttype.2009-04-14.8306352217-base_edit-tp2633359p2633359.html
Sent from the Product Developers mailing list archive at Nabble.com.


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to