[Zope3-dev] Re: Zope3 and workflow
Ivo van der Wijk
vladdrac at gmail.com
Tue May 3 08:32:18 EDT 2005
On 5/2/05, Ivo van der Wijk <vladdrac at gmail.com> wrote:
> Hi,
>
> I'm currently looking into Workflow and Zope3. For some reason, I'm
> running into the following, totally undescriptive error:
(snip)
Okay, I now know what's happening and why I have this problem.
There's a bug in Zope3 when you mix catalog, workflow and intid. The
following happens:
If cataloging *and* workflow have been enabled, and when you add
content, zope.app.catalog.catalog.indexDocSubscriber receives several
IntIdAddedEvent. One of them is for some workflow machinery content
that's added to an object.
indexDocSubscriber does not check if event.object provides IIntIds and
simply attempts to resolve the id through queryId. This fails in with
the following (highly cryptic) error:
File "/home/ivo/Work/Zope3/Zope3-svn/src/zope/app/keyreference/persistent.py",
line 65, in connectionOfPersistent
raise ValueError('Can not get connection of %r' % (ob,))
Adding explicit checks to the several subscribers as follows:
if not IIntIds.providedBy(event.object):
return
Fixes the problem.
i'm nost sure if this is the best fix - I think queryId could provide
a better error but as the catalog doesn't catch any exceptions I guess
it's best to leap before you junp.
I haven't committed any of this to the trunk yet - please let me know
if the fix is okay.
Cheers
Ivo
> Cheers
>
> Ivo
>
> --
> Drs. I.R. van der Wijk -=-
> Korte Leidsedwarsstraat 12 Amaze
> 1017 RC Amsterdam, NL -=-
> T +31-20-4688336 F +31-20-4688337 Zope/Plone/Content Management
> W http://www.amaze.nl E info at amaze.nl Open Source Solutions
> W http://vanderwijk.info E ivo at amaze.nl Consultancy
> PGP http://vanderwijk.info/pgp
>
--
Drs. I.R. van der Wijk -=-
Korte Leidsedwarsstraat 12 Amaze
1017 RC Amsterdam, NL -=-
T +31-20-4688336 F +31-20-4688337 Zope/Plone/Content Management
W http://www.amaze.nl E info at amaze.nl Open Source Solutions
W http://vanderwijk.info E ivo at amaze.nl Consultancy
PGP http://vanderwijk.info/pgp
More information about the Zope3-dev
mailing list