Sidnei da Silva <[EMAIL PROTECTED]> wrote:
> I'm facing a small issue with CMF 1.4 and the new 'feature' in Zope 2.8
> of letting exceptions through if getObject fails, instead of returning
> Specifically, in CMFCatalogAware.reindexObjectSecurity (recently
> introduced by Florent Guillaume if I recall), it assumes getObject()
> will return None in a failure.
Yes, see http://www.zope.org/Collectors/CMF/337 which I'm about to fix.
> This results in a traceback like this:
> Module Products.CMFDefault.DiscussionItem, line 311, in createReply
> Module Products.CMFCore.CMFCatalogAware, line 102, in
> Module Products.CMFCore.WorkflowTool, line 360, in notifyCreated
> Module Products.CMFCore.WorkflowTool, line 706, in
> Module Products.CMFCore.CMFCatalogAware, line 81, in
> Module Products.ZCatalog.CatalogBrains, line 74, in getObject
> Module OFS.Traversable, line 232, in restrictedTraverse
> Module OFS.Traversable, line 181, in unrestrictedTraverse
> - __traceback_info__: (, '1113527681')
> Module Products.CMFDefault.DiscussionItem, line 224, in
> AttributeError: 'dict' object has no attribute 'RESPONSE'
> There's two things going on here:
> 1. It is wrong in assuming getObject will return None. Well, actually
> it wasn't, but the carpet has been took away from under us :)
I'll change this.
> 2. If I understand correctly, it's trying to traverse to the
> newly-created DiscussionItem which though it's indexed, will not be
> available but two lines after the top-level call, on createReply,
> line 313.
> I assume there's a reason for the object to be indexed before being
> stored, so I won't try to guess what the correct fix is.
I'm not sure there's a good reason. This code looks quite dumb to me. It
should do a _setObject and _getOb and do the rest of the edit,
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED]
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests