In the past I had been disappointed with the upgrade process between
getpaid 0.6.1 and 0.7.0 because after the upgrade all my orders were
deleted and I could no longer add buyable items to my shopping cart.

I think I have found the solution to these problems. The important
steps seem to be deleting 'utilities' from the cascade list in
beforeUninstall(), and in not reinstalling intids (a utility) if it is
already installed. The problem with not being able to add items to the
cart went away after I removed getpaid.discount (which I was not using
anyway) from my buildout. I am using revision 2034 of the
getpaid.buildout trunk.

I am also using GetPaidStore.

Thanks,

Daniel Holth

Index: Products/PloneGetPaid/Extensions/install.py
===================================================================
--- Products/PloneGetPaid/Extensions/install.py (revision 2034)
+++ Products/PloneGetPaid/Extensions/install.py (working copy)
@@ -49,6 +49,7 @@
     directlyProvides(portal, directlyProvidedBy(portal) - IStore)

 def setup_order_manager( self ):
     portal = getToolByName( self, 'portal_url').getPortalObject()
     sm = portal.getSiteManager()
     is_already_registered = [u for u in
sm.getUtilitiesFor(IOrderManager)]
@@ -59,10 +60,12 @@
         except TypeError:
             # BBB for Zope 2.9
             sm.registerUtility(interface=IOrderManager,
utility=manager)
+    else:
+        # Noticed this path was never taken:
+        print "Keeping already registered IOrderManager"

 def setup_intid( self ):
     portal = getToolByName( self, 'portal_url').getPortalObject()
-    add_intids( portal )
+    # add_intids( portal )
+    # Cannot reinstall intids or all orders are lost

 def install_dependencies( self ):
     quickinstaller = self.portal_quickinstaller
@@ -226,7 +229,8 @@
     setup_tool = getToolByName(self, 'portal_setup')
     if shasattr(setup_tool, 'runAllImportStepsFromProfile'):
         # Plone 3
-        setup_tool.runAllImportStepsFromProfile('profile-
Products.PloneGetPaid:default')
+        setup_tool.runAllImportStepsFromProfile('profile-
Products.PloneGetPaid:default',
+                purge_old=False)
+       # Don't know whether purge_old=False has any effect
     else:
         # Plone 2.5.  Would work on 3.0 too, but then it gives tons
of
         # DeprecationWarnings when running the tests, causing
failures
@@ -238,6 +242,10 @@

     return out.getvalue()

+def beforeUninstall(self, reinstall=False, product=None, cascade=[]):
+    import pdb ; pdb.set_trace()
+    return True, cascade
+    # Here we must delete 'utilities' from the cascade list. I did it
in the debugger.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to