|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
possible solution for that cart error after buildoutLast 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 brandon@... 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 getpaid-dev@... To unsubscribe from this group, send email to getpaid-dev+unsubscribe@... For more options, visit this group at http://groups.google.com/group/getpaid-dev?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
|
Re: possible solution for that cart error after buildout
Hello.
I don't often contribute to this list, however FWIW - I encountered the same error & spent some time yanking on hair etc. I eventually discovered a hidden file in my build out (linux) directory entitled .buildout.cfg. Deleting this and doing bin/buildout -N seemed to fix the problem. Naturally, all site configuration info gets removed at the same time though ...sigh... RM -----Original Message----- From: Brandon Craig Rhodes <Brandon%20Craig%20Rhodes%20%3cbrandon@...> Reply-to: getpaid-dev@... To: getpaid-dev <getpaid-dev%20%3cgetpaid-dev@...> Subject: possible solution for that cart error after buildout Date: Thu, 24 Sep 2009 20:38:04 -0400
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? :-)
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "getpaid-dev" group. To post to this group, send email to getpaid-dev@... To unsubscribe from this group, send email to getpaid-dev+unsubscribe@... For more options, visit this group at http://groups.google.com/group/getpaid-dev?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
|
Re: possible solution for that cart error after buildoutBrandon,
We're reviewing the error we got on an instance. Not sure it is the same as you reported. What we found is the same as described here: http://code.google.com/p/getpaid/issues/detail?id=209 As you will see, there is a lot of discussion on this and several patches have been suggested. Though it sounds like the error could be related to what you found. Michael documents the steps to reproduce (comment 33, I believe). Hope that helps nail this one finally! Cheers, Chris On Fri, Sep 25, 2009 at 5:04 AM, Rob M <r.marino@...> wrote:
-- Cofounder and CEO ifPeople - Innovation for People www.ifpeople.net t: 678-608-3408 130 Boulevard NE, #6 Atlanta, GA 30312 --~--~---------~--~----~------------~-------~--~----~ GetPaid for Plone: http://www.plonegetpaid.com (overview info) | http://code.google.com/p/getpaid (code and issue tracker) You received this message because you are subscribed to the Google Groups "getpaid-dev" group. To post to this group, send email to getpaid-dev@... To unsubscribe from this group, send email to getpaid-dev+unsubscribe@... For more options, visit this group at
|
|
|
|
Re: possible solution for that cart error after buildoutHi all, Hope at least.. But strangely I don't have the method "doesCartContainItems( self, *args ):" in my broser/portlets/cart.py . I am running Getpaid 0.79 . I know I should update, but if I dont have the return bool( len( self.__parent__.cart ) ) statement. This line can't be the cause of my recent headaches. So, musn't the error be somewhere else also? I will update next week and give it a try.. Thanks, Rafael On Oct 8, 11:18 am, Christopher Johnson <cjj.ifpeo...@...> wrote: > Brandon, > > We're reviewing the error we got on an instance. Not sure it is the same as > you reported. What we found is the same as described here:http://code.google.com/p/getpaid/issues/detail?id=209 > As you will see, there is a lot of discussion on this and several patches > have been suggested. Though it sounds like the error could be related to > what you found. > > Michael documents the steps to reproduce (comment 33, I believe). > > Hope that helps nail this one finally! > > Cheers, > Chris > > > > On Fri, Sep 25, 2009 at 5:04 AM, Rob M <r.mar...@...> wrote: > > Hello. > > > I don't often contribute to this list, however FWIW - I encountered the > > same error & > > spent some time yanking on hair etc. I eventually discovered a hidden file > > in my > > build out (linux) directory entitled .buildout.cfg. Deleting this and doing > > bin/buildout -N > > seemed to fix the problem. Naturally, all site configuration info gets > > removed at the same > > time though ...sigh... > > > RM > > > -----Original Message----- > > *From*: Brandon Craig Rhodes <bran...@...<Brandon%20Craig%20Rhodes%20%3cbran...@...%3e> > > > *Reply-to*: getpaid-dev@... > > *To*: getpaid-dev <getpaid-dev@...<getpaid-dev%20%3cgetpaid-dev@...%3e> > > > *Subject*: possible solution for that cart error after buildout > > *Date*: Thu, 24 Sep 2009 20:38:04 -0400 > > > 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 3002https://getpaid.googlecode.com/svn/Products.PloneGetPaid/branches/bra... > > > Now, I want some other people to try this putative fix before I make any > > wild suggestions like merging this patch into "trunk". Anyone? :-) > > > Are you making all this up as you go along? > > -- > Cofounder and CEO > ifPeople - Innovation for Peoplewww.ifpeople.net > t: 678-608-3408 > 130 Boulevard NE, #6 > Atlanta, GA 30312 GetPaid for Plone: http://www.plonegetpaid.com (overview info) | http://code.google.com/p/getpaid (code and issue tracker) You received this message because you are subscribed to the Google Groups "getpaid-dev" group. To post to this group, send email to getpaid-dev@... To unsubscribe from this group, send email to getpaid-dev+unsubscribe@... For more options, visit this group at http://groups.google.com/group/getpaid-dev?hl=en?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |