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

Moving Asset from one Volume to another doesn't clear Custom Field data #3436

Closed
stevehurst opened this issue Nov 2, 2018 · 1 comment
Closed

Comments

@stevehurst
Copy link

stevehurst commented Nov 2, 2018

Description

I ran into this using Image Optimize which stores its array of images in a custom field.

One asset volume has the custom field, the other doesn't. I moved my assets from the volume with the custom field to the other without it, and the data persists in the database causing conditionals to return true and the Image Optimize plugin to not be able to process the unknown field:

Impossible to invoke a method ("src") on a string variable ("{"optimizedImageUrls":{"292":"/images/content/_292x293_crop_center-center_line/AA1.png"},"optimizedWebPImageUrls":{"292":"/images/content/_292x293_crop_center-center_line/AA1.png.webp"},"variantSourceWidths":["292"],"variantHeights":{"292":293},"focalPoint":{"x":0.5,"y":0.5},"originalImageWidth":"292","originalImageHeight":"293","placeholder":"","placeholderSvg":"","colorPalette":[],"placeholderWidth":292,"placeholderHeight":293}").

I contacted Andrew about this and he suggested this was possibly part of a bigger issue of Craft not clearing custom field data on asset changes.

I can see where keeping this data might be useful when transferring assets around volumes, and back again, but there's no way to clear the data otherwise.

@stevehurst stevehurst changed the title Assets moved to new volume don't clear custom field data Moving Asset from one Volume to another doesn't clear Custom Field data Nov 2, 2018
@brandonkelly
Copy link
Member

This is the same core issue described in #1898 and #1772. Will be resolved when we get to #1524 (planned for 3.2).

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