Comment 2 for bug 388997

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

AFAICT the exception should be caught in zope.app.form.browser.itemswidgets.SingleDataHelper.hidden:

    def hidden(self):
        #XXX: _getFormValue() should return a string value that can be
        # used in a HTML form, but it doesn't. When
        # http://www.zope.org/Collectors/Zope3-dev/584 gets fixed
        # this hack should be reverted.
        # -- Bjorn Tillenius, 2006-04-12
        value = self._getFormValue()
        if value == self._missing:
            form_value = ''
        else:
            form_value = self.vocabulary.getTerm(value).token
        return renderElement(u'input',
                             type='hidden',
                             name=self.name,
                             id=self.name,
                             value=form_value,
                             cssClass=self.cssClass,
                             extra=self.extra)

(Note that the bug referenced there is bug 98333, marked as "won't fix.")