1. 07 Mar, 2016 4 commits
    • Sebastien Robin's avatar
      BusinessTemplate: make sure we could modify broken objects before installation · 5bd898f0
      Sebastien Robin authored
      Like we already do for Documents, Tests and Extension, we are soon
      going to export as two files various types of document. It's usually
      one file for metadata, and one file for the content (code, text).
      Sometimes, we might want such kind of two file export for some  bt
      having portal type and instance of such portal type in the same time.
      In such case, we have some intermediate steps where we have broken
      objects, and we need to change theses broken objets before portal
      type is fully initialized and installed.
    • Sebastien Robin's avatar
      BusinessTemplate: fix installation of portal type and instance of that type · 34e13b7e
      Sebastien Robin authored
      Such error was raised :
      BrokenModified: Can't change broken objects
      We were installing a broken object even though the portal type was just
      installed. This was due to a missing reset of components.
    • Sebastien Robin's avatar
    • Sebastien Robin's avatar
      ERP5Type: avoid PicklingError with ERP5 broken objects · 5abbc5a7
      Sebastien Robin authored
      Following code, with foo having portal type Foo which is
      not installed yet (thus it is broken) :
      connection = self.getConnection(portal)
      foo = connection.importFile(file_obj) => this does a savepoint
      foo._p_changed = 1
      Then next savepoint was raising :
      PicklingError: Can't pickle <class 'erp5.portal_type.Foo'>: it's not the same object as erp5.portal_type.Foo )
      This was because we had :
      foo.__class__.mro() : (<class 'erp5.portal_type.Foo'>, <class 'ZODB.broken.PersistentBroken'>,
       <class 'ZODB.broken.Broken'>, <type 'persistent.Persistent'>, <class 'erp5.portal_type.Foo'>,
       <class 'Products.ERP5Type.dynamic.lazy_class.GhostBase'>,
       <class 'Products.ERP5Type.dynamic.lazy_class.ERP5BaseBroken'>, <class 'Products.ERP5Type.Base.Base'>, *TAIL)
      erp5.portal_type.__getattribute__("Foo").mro() :
      (<class 'erp5.portal_type.Foo'>, <class 'Products.ERP5Type.dynamic.lazy_class.ERP5BaseBroken'>,
        <class 'ZODB.broken.Broken'>, <class 'Products.ERP5Type.Base.Base'>, *TAIL)
      Classes where different because new class with new inheritance was created by
      ZODB.serialize.ObjecReader.load_persistent which does :
      if issubclass(klass, Broken):
          # We got a broken class. We might need to make it
          # PersistentBroken
          if not issubclass(klass, broken.PersistentBroken):
              klass = broken.persistentBroken(klass)
      Since ERP5BaseBroken is patched to mostly be like a PersistentBroken,
      make sure we allow serialization to identify ERP5BaseBroken as a
      PersistenBroken class.
  2. 04 Mar, 2016 6 commits
  3. 03 Mar, 2016 3 commits
  4. 02 Mar, 2016 12 commits
  5. 01 Mar, 2016 2 commits
  6. 29 Feb, 2016 2 commits
  7. 26 Feb, 2016 1 commit
  8. 25 Feb, 2016 8 commits
  9. 24 Feb, 2016 1 commit
  10. 23 Feb, 2016 1 commit