#43 — AttributeError: (selected layout)

by Lukas Zdych last modified Jun 20, 2012 01:21 AM
State Resolved
Version:
Area User interface
Issue type Bug
Severity Medium
Submitted by Lukas Zdych
Submitted on Jan 10, 2006
Responsible
Target release:




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

Added by Martin Aspeli on Jan 11, 2006 08:07 AM
Issue state: unconfirmedopen
Mmm... strange.

What happens when you do this in a standard Plone type, e.g. Page?
Added by Lukas Zdych on Jan 11, 2006 12:00 PM
I didn't think about to try it with std. Plone content ;) When I try the same steps with page I got the following error IndexError: list index out of range (only for "view" action, schemata and sharing are ok). That's strange as you said but maybe it should be reported to Archetypes or ATCT? ... I'm not sure..
Added by Martin Aspeli on Jan 22, 2006 12:14 AM
Issue state: openresolved
I'm pretty sure this is a plone bug that's manifesting itself slightly differently in Plone's types and Poi types. Portal factory is still the worst hack in Plone (or rather, it's solving an unsolveable problem)

No responses can be added.