plone / plone.formwidget.autocomplete

z3c.form widget for Plone using jQuery Autocomplete
https://pypi.org/project/plone.formwidget.autocomplete
2 stars 12 forks source link

NOVALUE LookupError on RelationChoice field #14

Closed MrTango closed 8 years ago

MrTango commented 9 years ago

I get the following error, if i try to setup AutocompleteSelectionWidget for a RelationChoice field. It seems related to:

Maybe we need to fix that Widget too, see:

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 60, in update
  Module z3c.form.form, line 161, in render
  Module zope.browserpage.viewpagetemplatefile, line 51, in __call__
  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 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 821, in do_loop_tal
  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 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 821, in do_loop_tal
  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 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 531, in do_optTag_tal
  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 zope.tales.tales, line 696, in evaluate
   - URL: /home/maik/develop/plone/.buildout/eggs/plone.app.z3cform-0.7.7-py2.7.egg/plone/app/z3cform/templates/macros.pt
   - Line 97, Column 46
   - Expression: <PathExpr standard:u'widget/@@ploneform-render-widget'>
   - Names:
      {'args': (),
       'context': <Library at /ub/ub-db/1>,
       'default': <object object at 0xb75116d0>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request': <HTTPRequest, URL=http://localhost:8080/ub/ub-db/1/@@edit>,
       'template': <zope.browserpage.viewpagetemplatefile.ViewPageTemplateFile object at 0xb47c0dec>,
       'view': <plone.dexterity.browser.edit.DefaultEditForm object at 0xb148b58c>,
       'views': <zope.browserpage.viewpagetemplatefile.ViewMapper object at 0xb14b50cc>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 155, in _eval
  Module Products.PageTemplates.Expressions, line 117, in render
  Module Products.Five.browser.metaconfigure, line 479, in __call__
  Module zope.browserpage.viewpagetemplatefile, line 83, in __call__
  Module zope.browserpage.viewpagetemplatefile, line 51, in __call__
  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 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 531, in do_optTag_tal
  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 zope.tales.tales, line 696, in evaluate
   - URL: /home/maik/develop/plone/.buildout/eggs/plone.app.z3cform-0.7.7-py2.7.egg/plone/app/z3cform/templates/widget.pt
   - Line 37, Column 4
   - Expression: <PathExpr standard:u'widget/render'>
   - Names:
      {'args': (),
       'context': <AutocompleteSelectionWidget 'form.widgets.integrated_in'>,
       'default': <object object at 0xb75116d0>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request': <HTTPRequest, URL=http://localhost:8080/ub/ub-db/1/@@edit>,
       'template': <zope.browserpage.viewpagetemplatefile.ViewPageTemplateFile object at 0xb4a4974c>,
       'view': <Products.Five.metaclass.RenderWidget object at 0xb148bdcc>,
       'views': <zope.browserpage.viewpagetemplatefile.ViewMapper object at 0xb148bf4c>}
  Module zope.tales.expressions, line 217, in __call__
  Module zope.tales.expressions, line 211, in _eval
  Module plone.formwidget.autocomplete.widget, line 124, in render
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  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 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: /home/maik/develop/plone/.buildout/eggs/plone.formwidget.autocomplete-1.2.7-py2.7.egg/plone/formwidget/autocomplete/input.pt
   - Line 3, Column 4
   - Expression: <PathExpr standard:u'view/renderQueryWidget'>
   - Names:
      {'args': (<AutocompleteSelectionWidget 'form.widgets.integrated_in'>,),
       'container': <Library at /ub/ub-db/1>,
       'context': <Library at /ub/ub-db/1>,
       'default': <object object at 0xb75116d0>,
       'here': <Library at /ub/ub-db/1>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xb13995a4>,
       'request': <HTTPRequest, URL=http://localhost:8080/ub/ub-db/1/@@edit>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xb4d730ec>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <AutocompleteSelectionWidget 'form.widgets.integrated_in'>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xb147fe0c>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 155, in _eval
  Module Products.PageTemplates.Expressions, line 117, in render
  Module z3c.formwidget.query.widget, line 212, in renderQueryWidget
  Module z3c.form.widget, line 153, in render
  Module zope.browserpage.viewpagetemplatefile, line 51, in __call__
  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 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 821, in do_loop_tal
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  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 zope.tales.tales, line 696, in evaluate
   - URL: /home/maik/develop/plone/.buildout/eggs/z3c.form-3.2.3-py2.7.egg/z3c/form/browser/radio_input.pt
   - Line 8, Column 4
   - Expression: <PythonExpr (view.renderForValue(item['value']))>
   - Names:
      {'args': (),
       'context': <Library at /ub/ub-db/1>,
       'default': <object object at 0xb75116d0>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request': <HTTPRequest, URL=http://localhost:8080/ub/ub-db/1/@@edit>,
       'template': <zope.browserpage.viewpagetemplatefile.ViewPageTemplateFile object at 0xb482ab6c>,
       'view': <AutocompleteSelectionWidget 'form.widgets.integrated_in'>,
       'views': <zope.browserpage.viewpagetemplatefile.ViewMapper object at 0xb13e57ec>}
  Module zope.tales.pythonexpr, line 59, in __call__
   - __traceback_info__: (view.renderForValue(item['value']))
  Module <string>, line 1, in <module>
  Module z3c.form.browser.radio, line 44, in renderForValue
  Module z3c.form.term, line 38, in getTermByToken
  Module zope.schema.vocabulary, line 133, in getTermByToken
LookupError: --NOVALUE--
mauritsvanrees commented 8 years ago

I have released z3c.form 3.2.9 which has a fix.