Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view folder_contents broken if contains any item with image field filled #565

Open
sauzher opened this issue Dec 11, 2024 · 3 comments
Open

Comments

@sauzher
Copy link

sauzher commented Dec 11, 2024

There is a Plone bug I just discovered (and reproduced even on classic.demo.plone.org)
Long story short: we cannot have a catalog metadata column named like any dexterity blob field.

isaw.policy adds up a portal_catalog column metadata called image; this name matches some named blob imaged fields no matter the portal_type (Image, exibitions... )

This breaks folder_contents view if it contains items implementing a populated blob field named image. More precisely it'll break the items json representation in the @@getVocabulary call:

This is the python repr: the image field contains an object no json serializable

{'CreationDate': '2024-12-06T11:12:43-05:00',
[ ... ]
 'getMimeIcon': '/isawnotheme/++resource++mimetype.icons/txt.png',
 'getObjSize': '890.0 KB',
 'getURL': 'http://localhost:8081/isawnotheme/esibizione-1',
'id': 'esibizione-1',

 'image': <plone.namedfile.file.NamedBlobImage object at 0x7f5babcf17d0>,

[ ... ]

 'total_comments': 0}

Brute solution to me, is to remove metadata "image" from the catalog. It seems that it's never used/accessed in the code, It only appears as old ATCT Topic columns configuration and so, there might be some Topic/Collection around configured to show the "image" field in topic tabular view.

@alecpm What do you think?

@sauzher
Copy link
Author

sauzher commented Dec 11, 2024

ref. plone/Products.CMFPlone#4078

sauzher added a commit that referenced this issue Dec 11, 2024
we cannot have image field as metadata catalog
@alecpm
Copy link

alecpm commented Dec 11, 2024

Removing that column seems like a very good idea. Alternatively we could register an indexed for it that behaved in whatever way the code intended that column to behave (which probably wasn’t storing the blob (or a reference to it) in the catalog.

@sauzher
Copy link
Author

sauzher commented Dec 12, 2024

Good point. I'd say, we go for removal today. if tomorrow the column will be necessary for any Collection we'll implement the index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants