Comments (7)
Confirmed
from collective.z3cform.datagridfield.
Preliminary investigation of the traceback:
Module collective.z3cform.datagridfield.datagridfield, line 283, in value
Module plone.app.z3cform.converters, line 361, in toWidgetValue
Module plone.app.z3cform.converters, line 362, in <listcomp>
value
is a UUID (as string). Expected: list of UUIDs
So the list comprehension iterates over the single chars of the UUID which explains the adapation error for single chars of the UUID.
As a workaround, I tried to converted value
into [value]
.
With this workaround, the IUUID
lookup fails for a correct (existing UUID).
I verified that by searching for the portal_catalog by the given UUID.
So obviously, a list of UUIDs get converted somewhere in the stack to a string (or even the UI sends improper data).
from collective.z3cform.datagridfield.
A modified version of the converter seems to work for us and possibly resolves the problem
def toWidgetValue(self, value):
"""Converts from field value to widget.
:param value: List of catalog brains.
:type value: list
:returns: List of of UID separated by separator defined on widget.
:rtype: string
"""
if not value:
return self.field.missing_value
separator = getattr(self.widget, "separator", ";")
if IRelationList.providedBy(self.field):
if isinstance(value, str):
value = [value]
return separator.join(v for v in value if v)
else:
return separator.join([IUUID(o) for o in value if o])
else:
return separator.join(v for v in value if v)
from collective.z3cform.datagridfield.
Confirmed. I've made a PR here #142 ... turns out, that the context binding on the IChoice
columns was wrong ... with this fix it works for me.
from collective.z3cform.datagridfield.
One more update here #150
I've fixed the DictRowConverter
to correctly convert the columns to their schema field/widget values. This fixes several issues for me when using Choice
fields in the DictRow
schema.
from collective.z3cform.datagridfield.
@petschki I can confirm that your PR fixes the issue where the relation field is not working correctly
from collective.z3cform.datagridfield.
Fixed by #150
from collective.z3cform.datagridfield.
Related Issues (20)
- "Tab" generates one new entry to proceeds to the next datagrid field instance
- Pickling Error with RelationList inside DictRow in AddForms
- Issues with auto append HOT 1
- Imports removal (__init__.py) leads to ImportError & obsolete documentation HOT 2
- New release HOT 2
- AutoExtensibleSubformAdapter breaks the schema editor settings popup for certain fields HOT 1
- Shouldn't the datagridfield_input template respect view/klass or at least view/display_table_css_class ? HOT 2
- Get rid of removed ISubformFactory (z3c.form) HOT 1
- Plone6 add object error HOT 1
- schema.Date and schema.Datetime converter broken HOT 3
- Selected vocabulary value is not saved HOT 6
- Incorrect translation domain in update.py HOT 1
- Uncorrect data grid field int column deserializing
- Required fields error messages can be misleading
- Bug introduced with new DictRowConverter -> BooleanWidget gets set to `True` when editing. HOT 3
- DictRow with Choice: ConstraintNotSatisfied HOT 2
- Release 3.0.1 HOT 1
- InvalidVocabularyError when using nested DGF field with Choice field and IContextSourceBinder HOT 1
- WrongContainedType for Boolean Field in Plone 6.0.2 using SingleCheckBoxWidget in IRegistry Control Panel, when saving HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collective.z3cform.datagridfield.