Skip to content

Recycle bin: can't delete item with a preview image #4172

Description

@davisagli

This is a bug found while testing #4168 (but maybe it is an existing problem).

Steps to reproduce:

  1. In the Content Types control panel, enable the "Preview Image Link" behavior for the Page content type.
  2. Add an image.
  3. Add a page, and set its preview image to the image from step 2
  4. Try to delete the image, and choose Yes to delete it even though it will break the link.

Expected: The image is deleted and appears in the recycle bin.
Actual: There's an alert "there was an error performing the action"

In the terminal, there's a traceback:

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 187, in transaction_pubevents
  Module transaction._manager, line 255, in commit
  Module transaction._manager, line 132, in commit
  Module transaction._transaction, line 267, in commit
  Module transaction._transaction, line 333, in _callBeforeCommitHooks
  Module transaction._transaction, line 372, in _call_hooks
  Module Products.CMFCore.indexing, line 317, in before_commit
  Module Products.CMFCore.indexing, line 227, in process
  Module Products.CMFCore.indexing, line 49, in reindex
  Module Products.CMFCore.CatalogTool, line 368, in _reindexObject
  Module Products.CMFPlone.CatalogTool, line 326, in catalog_object
  Module Products.ZCatalog.ZCatalog, line 495, in catalog_object
  Module Products.ZCatalog.Catalog, line 337, in catalogObject
  Module Products.ZCatalog.Catalog, line 282, in updateMetadata
  Module Products.ZCatalog.Catalog, line 415, in recordify
  Module plone.indexer.wrapper, line 66, in __getattr__
  Module plone.indexer.delegate, line 18, in __call__
  Module Products.CMFPlone.image_scales.indexer, line 19, in image_scales
  Module Products.CMFPlone.image_scales.adapters, line 30, in __call__
  Module plone.volto.behaviors.preview_link, line 78, in __call__
TypeError: ('Could not adapt', None, <InterfaceClass plone.rfc822.interfaces.IPrimaryFieldInfo>)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions