Last week, cjj asked if I had yet seen The Error that people get when
they already have something in their shopping cart, and re-run buildout,
and then have the portlet crash. He was not sure how to reproduce it,
so I said I would look into it if the problem happened to strike me.
Well, it just happened! So I looked into it. The offending code was an
expression in the GetPaid shopping cart portlet renderer that tried to
get hold of the "cart" object by looking for such an attribute on the
raw Plone site-root object:
return bool( len( self.__parent__.cart ) )
While most of GetPaid remains a mystery to me, this just looked somehow
inadvisable, so I took a look at the full cart view, which was still
working, to see how it gets the shopping cart object. Its approach
seemed much more sensible:
cart_manager = component.getUtility( interfaces.IShoppingCartUtility )
self._cart = cart = cart_manager.get( self.context, create=True )
return cart
So I cut-and-pasted this code (along with a few "import" statements)
into the portlet, and it's now working just fine for me. To see the
patch in the wild, run:
svn diff -c 3002
https://getpaid.googlecode.com/svn/Products.PloneGetPaid/branches/brandon-no-overrides
Now, I want some other people to try this putative fix before I make any
wild suggestions like merging this patch into "trunk". Anyone? :-)
--
Brandon Craig Rhodes [email protected] http://rhodesmill.org/brandon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"getpaid-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/getpaid-dev?hl=en
-~----------~----~----~----~------~----~------~--~---