- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: value or token must be provided (only one of those) #121
Comments
I will make a pull request shortly to fix/enhance this |
A few days ago I just stumbled upon the same issue. But I solved it in another way. My request looks like this: In this request it seems that
To this: if not value or value == (None,):
return self.field.missing_value I thought the best way would be to return the The other thing is: I get a
|
Thank you for this information :) And for the note. You are totally right that it should be a ValueError not an AttributeError. I will change that in my Pullrequest! |
The original error is still there. Steps to reproduce
<model xmlns:i18n="http://xml.zope.org/namespaces/i18n" xmlns:marshal="http://namespaces.plone.org/supermodel/marshal" xmlns:form="http://namespaces.plone.org/supermodel/form" xmlns:security="http://namespaces.plone.org/supermodel/security" xmlns:users="http://namespaces.plone.org/supermodel/users" xmlns:lingua="http://namespaces.plone.org/supermodel/lingua" xmlns:easyform="http://namespaces.plone.org/supermodel/easyform" xmlns="http://namespaces.plone.org/supermodel/schema">
<schema>
<field name="users" type="zope.schema.List">
<form:widget type="plone.formwidget.autocomplete.AutocompleteMultiFieldWidget"/>
<description/>
<required>False</required>
<title>Users</title>
<value_type type="zope.schema.Choice">
<vocabulary>plone.app.vocabularies.Users</vocabulary>
</value_type>
</field>
</schema>
</model> Searching for non existing user on the ++add++ form results:
As it is pointed out in https://github.com/NicolasGoeddel's #121 (comment) the There is also a quite nice summary on the reasons behind it plone/plone.app.dexterity#311 (comment). The best fix seems to be the |
Versionen:
AddOn I tested: python3-branch vom MasterSelectWidget (https://github.com/collective/plone.formwidget.masterselect)
Error got up as I tried to use the vocabulary_method to change another fields input.
2020-11-25 14:19:30,830 ERROR [Zope.SiteErrorLog:251][waitress] 1606310370.82950660.9245520262157388 http://localhost:8080/Plone/++add++HULSFPage/++widget++studyCourse Traceback (innermost last): Module ZPublisher.WSGIPublisher, line 155, in transaction_pubevents Module ZPublisher.WSGIPublisher, line 337, in publish_module Module ZPublisher.WSGIPublisher, line 243, in publish Module ZPublisher.BaseRequest, line 523, in traverse Module ZPublisher.BaseRequest, line 330, in traverseName Module zope.traversing.namespace, line 165, in namespaceLookup Module plone.z3cform.traversal, line 54, in traverse Module plone.dexterity.browser.add, line 141, in update Module plone.z3cform.fieldsets.extensible, line 65, in update Module plone.z3cform.patch, line 30, in GroupForm_update Module z3c.form.group, line 141, in update Module z3c.form.group, line 52, in update Module z3c.form.group, line 48, in updateWidgets Module z3c.form.field, line 277, in update Module plone.app.z3cform.widget, line 443, in update Module z3c.form.browser.text, line 36, in update Module z3c.form.browser.widget, line 171, in update Module Products.CMFPlone.patches.z3c_form, line 47, in _wrapped Module z3c.form.widget, line 132, in update Module plone.app.z3cform.converters, line 181, in toWidgetValue Module plone.app.vocabularies.principals, line 147, in getTerm Module plone.app.vocabularies.principals, line 113, in _get_term_from_source ValueError: value or token must be provided (only one of those)
The text was updated successfully, but these errors were encountered: