Ticket #7295 (closed Bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Comparing Revisions for Folders break when folder is syndicated

Reported by: davidray Owned by: alecm
Priority: minor Milestone: 3.0.4
Component: Versioning Version:
Keywords: Cc:

Description

When a folder has been syndicated, a 'syndication_information' object is placed within the folder.

Pressing the 'Compare to previous revision' link returns an AttributeError from CMFDiffTool:

Module zope.tales.tales, line 696, in evaluate
   - URL: file:/opt/Zope-2.10.4/dev/dray/eduCommons/Products/CMFEditions/skins/CMFEditions/version_diff.pt
   - Line 17, Column 2
   - Expression: <PythonExpr here.getVersionDiff(id1,id2)>
   - Names:
      {'container': <PloneSite at /MITR>,
       'context': <Course at /MITR/division/test-course>,
       'default': <object object at 0x44528>,
       'here': <Course at /MITR/division/test-course>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x6e88738>,
       'request': <HTTPRequest, URL=http://localhost:8210/MITR/division/test-course/version_diff>,
       'root': <Application at >,
       'template': <FSPageTemplate at /MITR/version_diff used for /MITR/division/test-course>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'dray'>}
  Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
   - __traceback_info__: here.getVersionDiff(id1,id2)
  Module PythonExpr, line 1, in <expression>
  Module Products.CMFCore.FSPythonScript, line 140, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.CMFCore.FSPythonScript, line 196, in _exec
  Module None, line 12, in getVersionDiff
   - <FSPythonScript at /MITR/getVersionDiff used for /MITR/division/test-course>
   - Line 12
  Module Products.CMFDiffTool.CMFDiffTool, line 153, in createChangeSet
  Module Products.CMFDiffTool.ChangeSet, line 152, in computeDiff
  Module Products.CMFDiffTool.ChangeSet, line 157, in _addSubSet
  Module Products.CMFDiffTool.ChangeSet, line 121, in computeDiff
  Module Products.CMFDiffTool.CMFDiffTool, line 130, in computeDiff
AttributeError: portal_type

This is due to the syndication_information object not having a portal_type. Haven't figured out the proper way to correct this...if anyone needs a quick hack, this appears to do the trick in Products.CMFDiffTool.CMFDiffTool line 129:

        # Try to get the portal type from obj1 first.  If that fails, use obj2
        try:
            pt_name = aq_base(ob1).portal_type
        except AttributeError:
            try:
                pt_name = aq_base(ob2).portal_type
            except AttributeError:
                if ob2.id == 'syndication_information':
                    pt_name = 'syndication_information'

Change History

comment:1 Changed 6 years ago by davidray

  • Summary changed from Versioning for Folders break when folder is syndicated to Comparing Revisions Folders break when folder is syndicated

comment:2 Changed 6 years ago by davidray

  • Summary changed from Comparing Revisions Folders break when folder is syndicated to Comparing Revisions for Folders break when folder is syndicated

comment:3 Changed 6 years ago by alecm

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in CMFDiffTool r54503 and a related fix in CMFEditions r54504

Note: See TracTickets for help on using tickets.