Ticket #14169 (confirmed Feature Request)

Opened 22 months ago

Last modified 20 months ago

Dexterity FTI: typo in schema interface results in infinite recursion

Reported by: jensens Owned by:
Priority: minor Milestone: 4.x
Component: Dexterity Version: 4.3
Keywords: dexterity Cc: saily

Description

If one (like me) has a typo in the dotted path to an interface, i.e.:

for some.package.interfaces.IMyType one types:

<property name="schema">some.package.intarfaces.IMyType</property>

On add an infinite recursion error happens.

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 plone.z3cform.layout, line 66, in __call__
  Module plone.z3cform.layout, line 50, in update
  Module plone.dexterity.browser.add, line 112, in update
  Module plone.z3cform.fieldsets.extensible, line 58, in update
  Module plone.autoform.form, line 31, in updateFields
  Module plone.autoform.base, line 55, in updateFieldsFromSchemata
  Module plone.dexterity.browser.base, line 28, in schema
  Module plone.dexterity.fti, line 233, in lookupSchema
  Module plone.alterego.dynamic, line 25, in __getattr__
  Module plone.synchronize.decorator, line 9, in synchronized_function
  Module plone.dexterity.schema, line 189, in __call__
  Module plone.dexterity.fti, line 245, in lookupModel
  Module plone.dexterity.fti, line 233, in lookupSchema
  Module plone.alterego.dynamic, line 25, in __getattr__
  Module plone.synchronize.decorator, line 9, in synchronized_function
  Module plone.dexterity.schema, line 189, in __call__
  Module plone.dexterity.fti, line 245, in lookupModel
  Module plone.dexterity.fti, line 233, in lookupSchema
  Module plone.alterego.dynamic, line 25, in __getattr__
  ... several times ...
  Module plone.synchronize.decorator, line 9, in synchronized_function
  Module plone.dexterity.schema, line 189, in __call__
  Module plone.dexterity.fti, line 245, in lookupModel
RuntimeError: maximum recursion depth exceeded while calling a Python object

This is ugly, instead there must be a verbose error message telling something about a non-existing Interface or alike.

Change History

comment:1 Changed 22 months ago by saily

  • Cc saily added

+1

comment:2 Changed 20 months ago by cwainwright

  • Status changed from new to confirmed
  • Component changed from Unknown to Dexterity
  • Type changed from Bug to Feature Request
Note: See TracTickets for help on using tickets.