plomino / Plomino

Powerful and flexible web-based application builder
33 stars 37 forks source link

Errror when adding a label to a numberfield #622

Closed djay closed 9 years ago

djay commented 9 years ago
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 Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 237, in _exec
Module Products.CMFCore.FSPageTemplate, line 177, in pt_render
Module Products.PageTemplates.PageTemplate, line 79, in pt_render
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module zope.pagetemplate.pagetemplate, line 240, in __call__
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 946, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
Module zope.tales.tales, line 696, in evaluate
URL: file:/var/buildout/buildout-cache/pretaweb/eggs/Products.CMFPlomino-1.18dev_ZZ9GxYavanFD8wRjZ9WQjQ-py2.7.egg/Products/CMFPlomino/skins/cmfplomino_templates/OpenForm.pt
Line 156, Column 24
Expression: <PythonExpr here.openBlankForm(request)>
Names:
{'container': <PlominoForm at /05/mnt/www/DWP eforms/virginias-testing/voting-rego/voting-rego>,
 'context': <PlominoForm at /05/mnt/www/DWP eforms/virginias-testing/voting-rego/voting-rego>,
 'default': <object object at 0x7f11144a2510>,
 'here': <PlominoForm at /05/mnt/www/DWP eforms/virginias-testing/voting-rego/voting-rego>,
 'loop': {},
 'nothing': None,
 'options': {'args': ()},
 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7f10d8c39470>,
 'request': <HTTPRequest, URL=https://admin.pretagov.co.uk/05/mnt/www/DWP%20eforms/virginias-testing/voting-rego/voting-rego/OpenForm>,
 'root': <Application at >,
 'template': <FSPageTemplate at /05/mnt/www/DWP eforms/virginias-testing/voting-rego/voting-rego/OpenForm>,
 'traverse_subpath': [],
 'user': <PropertiedUser 'pretaweb'>}
Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
__traceback_info__: here.openBlankForm(request)
Module PythonExpr, line 1, in <expression>
Module Products.CMFPlomino.PlominoForm, line 1020, in openBlankForm
Module Products.CMFPlomino, line 166, in newf
Module Products.CMFPlomino.PlominoForm, line 665, in displayDocument
Module Products.CMFPlomino.PlominoForm, line 570, in _handleLabels
AttributeError: 'NumberField' object has no attribute 'widget'
jean commented 9 years ago

Hmm it should be checking for widget first (https://github.com/plomino/Plomino/blob/github-main/Products/CMFPlomino/PlominoForm.py#L599):

        if hasattr(field.getSettings(), 'widget'):
            widget_name = field.getSettings().widget
jean commented 9 years ago

Fixed in current code.