#43 — AttributeError: (selected layout)
|Submitted by||Lukas Zdych|
|Submitted on||Jan 10, 2006|
Common users sometimes try to click on 'view' action of base_edit form when creating new issues or responses which causes an error (see the traceback below) because the object is in that moment instanciated in portal_factory and not physically in the tracker.
Traceback (innermost last):
Module ZPublisher.Publish, line 113, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 40, in call_object
Module Products.CMFPlone.FactoryTool, line 363, in __call__
Module OFS.Traversable, line 233, in restrictedTraverse
Module OFS.Traversable, line 182, in unrestrictedTraverse
- __traceback_info__: (, '(selected layout)')
Module Products.Archetypes.BaseObject, line 1072, in __bobo_traverse__
AttributeError: (selected layout)
I think that there can be two of possible solutions (simply - not sure if definite):
1. hide "view" action when the object is not fully created, I mean if it is in initial-state (add the following condition to view action of issue and response - python:portal.portal_workflow.getInfoFor(object, "review_state") != "new")
2. hide border to users except the manager maybe
* this will constrain users to click on "cancel" button in the edit form if they want to cancel object creation
I like the first way (I used it and it works fine).
- Steps to reproduce:
click on action "submit new issue" or "add response"
click on "view" action
What happens when you do this in a standard Plone type, e.g. Page?
No responses can be added.