Giter VIP home page Giter VIP logo

Comments (7)

zopyx avatar zopyx commented on July 17, 2024

Confirmed

from collective.z3cform.datagridfield.

zopyx avatar zopyx commented on July 17, 2024

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>

plone.app.z3cform.converters

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.

zopyx avatar zopyx commented on July 17, 2024

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.

petschki avatar petschki commented on July 17, 2024

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.

petschki avatar petschki commented on July 17, 2024

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.

laulaz avatar laulaz commented on July 17, 2024

@petschki I can confirm that your PR fixes the issue where the relation field is not working correctly 👍

from collective.z3cform.datagridfield.

laulaz avatar laulaz commented on July 17, 2024

Fixed by #150 👍

from collective.z3cform.datagridfield.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.