[Zope-dev] Bug fix: ZCatalog doesn't add vocabulary if vocab_id is omitted in manage call. manage call.

R. David Murray bitz@bitdance.com
Mon, 3 Jul 2000 14:35:37 -0400 (EDT)


In both 2.2.0b3 and a CVS checkout from 7/1, there's a small bug in
ZCatalog.manage_addZCatalog.  If you call it and don't supply a
vocab_id argument, vocab_id defaults to None.  But the code turns
that into the *string* "None", and when ZCatalog's init method sees
that it thinks its a real vocabulary name and does not create a
default vocabulary.  I fixed it by changing:

    vocab_id=str(vocab_id)
    if vocab_id == 'create_default_catalog_':
        vocab_id = None

to

    if vocab_id is not None:
        vocab_id=str(vocab_id)
        if vocab_id == 'create_default_catalog_':
            vocab_id = None

although a better fix might be to make the default value of vocab_id
be the string "create_default_catalog_".

I've put this in the collector.

By the way, the collector pages ought to have a link explaining what format
patches should be submitted in.  I just stuck the above in my
descrpition text, since I couldn't find docs on the patch format.

--RDM