zope.app.component.vocabulary.UtilityTerm not implemented correctly

Bug #99403 reported by Gabi Shaar
2
Affects Status Importance Assigned to Milestone
Zope 3
Status tracked in 3.4
3.4
Fix Released
Medium
Unassigned

Bug Description

In zope.app.component.vocabulary:
 UtilityVocabulary (which implements IVocabularyTokenized) uses UtilityTerm which should (by the documentation of IVocabularyTokenized) implement ITitledTokenizedTerm, and doesn't implement the title property.

Revision history for this message
Christian Theune (ctheune) wrote :

Hmm. Do you say that UtilityTerm is used as if it would implement ITitleTokenizedTerm? Can you point to the line of code? I didn't see this.

Changed in zope3:
status: Unconfirmed → Needs Info
Revision history for this message
Gabi Shaar (gabi-shaargiora) wrote :

I know of no code in zope that does this. I wrote my own widget for IChoice/IVocabularyTokenized (was using my own vocabularies, so only ran into this a bit later). So either the documentation needs to be corrected, or my code :).

this id the part in zope.schema.interfaces :

class IVocabularyTokenized(IVocabulary):
    """Vocabulary that provides support for tokenized representation.

    Terms returned from getTerm() and provided by iteration must
    conform to ITitledTokenizedTerm.
    """
    # ^^^^^^^^^^^^^^^^^^

    def getTermByToken(token):
        """Return an ITokenizedTerm for the passed-in token.

        If `token` is not represented in the vocabulary, `LookupError`
        is raised.
        """

Revision history for this message
Christian Theune (ctheune) wrote :

Ah, thanks for the info. The documentation of VocabularyTokenized is faulty. The method getTermByToken says it returns an ITokenizedTerm. I think this was a typo and changed it to ITokenizedTerm.

Changed in zope3:
importance: Undecided → Medium
status: Needs Info → Fix Committed
Revision history for this message
Philipp von Weitershausen (philikon) wrote :

Setting status to "Fix Released", we've had a two 3.4.0 betas since the fix was committed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.