Ticket #12949 (confirmed Bug)

Opened 4 years ago

Last modified 4 years ago

Exception when using CMFEditions with collective.contentleadimage on File Object

Reported by: ivanteoh Owned by: alecm
Priority: major Milestone: 4.x
Component: Versioning Version: 4.2
Keywords: patch Cc:

Description

to reproduce this error.

Install contentleadimage and cmfeditions. Under types make versions for File = Automatic. When you click edit on a file it works fine. Now go to Site Setup and add File to the list of types contentleadimage applies to. When trying to save a file you will get the following error.

http://localhost:8080/cmcintra/feature/copy_of_we/atct_edit
Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module Products.CMFFormController.FSControllerPageTemplate, line 91, in __call__
  Module Products.CMFFormController.BaseControllerPageTemplate, line 28, in _call
  Module Products.CMFFormController.ControllerBase, line 231, in getNext
  Module Products.CMFFormController.Actions.TraverseTo, line 38, in __call__
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module Products.CMFFormController.FSControllerPythonScript, line 107, in __call__
  Module Products.CMFFormController.ControllerBase, line 231, in getNext
  Module Products.CMFFormController.Actions.TraverseTo, line 38, in __call__
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module Products.CMFFormController.FSControllerPythonScript, line 105, in __call__
  Module Products.CMFFormController.Script, line 145, in __call__
  Module Products.CMFCore.FSPythonScript, line 127, in __call__
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 344, in _exec
  Module script, line 1, in content_edit
   - <FSControllerPythonScript at /cmcintra/feature/copy_of_we/content_edit>
   - Line 1
  Module Products.CMFCore.FSPythonScript, line 127, in __call__
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 344, in _exec
  Module script, line 12, in content_edit_impl
   - <FSPythonScript at /cmcintra/feature/copy_of_we/content_edit_impl>
   - Line 12
  Module Products.Archetypes.BaseObject, line 670, in processForm
  Module zope.event, line 31, in notify
  Module zope.component.event, line 24, in dispatch
  Module zope.component._api, line 136, in subscribers
  Module zope.component.registry, line 321, in subscribers
  Module zope.interface.adapter, line 585, in subscribers
  Module zope.component.event, line 32, in objectEventNotify
  Module zope.component._api, line 136, in subscribers
  Module zope.component.registry, line 321, in subscribers
  Module zope.interface.adapter, line 585, in subscribers
  Module Products.CMFEditions.subscriber, line 64, in objectEdited
  Module Products.CMFEditions.subscriber, line 44, in webdavObjectEventHandler
  Module Products.CMFEditions.utilities, line 123, in maybeSaveVersion
  Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 299, in save
  Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 445, in _recursiveSave
  Module Products.CMFEditions.ArchivistTool, line 265, in prepare
  Module Products.CMFEditions.ModifierRegistryTool, line 145, in getReferencedAttributes
  Module Products.CMFEditions.StandardModifiers, line 1188, in getReferencedAttributes
AttributeError: 'NoneType' object has no attribute 'getBlob'

Change History

comment:1 Changed 4 years ago by djay

  • Cc davisagli added

This is painful blocker for us. It looks like it's caused when leadimage is turned on for files and then later it's turned off. The code in CMFEditions assumes the schema is always attached and therefore fails. We want to fix this but we don't understand the code in CMFEditions enough. Can someone who knows the code give us some pointers?

comment:2 Changed 4 years ago by kleist

  • Priority changed from minor to major
  • Owner set to alecm
  • Component changed from Unknown to Versioning

comment:3 Changed 4 years ago by davisagli

  • Cc davisagli removed

comment:4 Changed 4 years ago by djay

We propose putting a try except pass around the offending code which is doing the getField(name) for a field that doesn't exist on the schema. However we don't know the implications of that change. We'll do this and submit a pull request and see if anyone can shed light on if this might cause problems later.

comment:5 Changed 4 years ago by kleist

  • Status changed from new to confirmed

comment:6 Changed 4 years ago by ivanteoh

We tried to fix it but we are not 100% sure any side effect. Here is the pull request link,  https://github.com/plone/Products.CMFEditions/pull/5.

comment:7 Changed 4 years ago by kleist

  • Keywords patch added
Note: See TracTickets for help on using tickets.