cms
cms copied to clipboard
Focal point not saved when blueprint has no fields
Bug Description
When setting a focal point on an image which is connected to an empty blueprint, the focal point is not saved.
How to Reproduce
- delete all fields in the blueprint of the asset container so that it has no fields
- set a focal point on one of the assets
- look in the meta data file --> only last_modified is updated
Environment
Statamic 3.0.31 Pro Laravel 7.29.3 PHP 7.3.24 statamic/migrator dev-master
Install method (choose one):
- Fresh install from
statamic/statamic
Seems to be working fine for me. I removed all the fields from my asset container's blueprint so it was left looking like this:
sections:
main:
display: Main
fields: { }
I then opened up one of my asset's meta yaml files in my code editor, and removed its contents. Then I went into the Asset library, set a focal point and saved my changes. I then confirmed that there was data set inside the asset's meta yaml file, including the focal point.
The focal point also changed fine for me when I updated it.
I am not sure about you guys, but I just experienced that issue again and it bugs me a lot...
Statamic 3.2.17 Pro Laravel 8.66.0 PHP 8.0.8 No addons installed
Asset blueprint has no fields and the meta file of the asset looks like this:
data: { }
size: 30886
last_modified: 1635353102
width: 1440
height: 2880
mime_type: image/png
When I then try to update the focal point, its not saved to the file! Annoying! Can someone try to reproduce?
Can you provide a repo with this problem reproduced?
@jasonvarga I just reproduced this issue in a fresh install. so really nothing special configured. but anyways I created a repo: https://github.com/marcusand/statamic-focal-point-issue try to set the focal point on the image in the "main" asset container. does not work for me.
I can recreate it if i don't save any asset meta data before removing the alt tag on a container blueprint. This might be a helpful clue. 🕵️♀️
Was able to just reproduce it on a fresh 3.3.14 via CLI.
I had to edit the blueprint from the CP and just hit save without doing anything else to the blueprint for the alt text and focal point to get saved.
If the assets.yaml is like @duncanmcclean's it also doesn't save the focal point.
I looked into this and just wanted to let you know that I have found a fix for this and will open a PR at start of October for Hacktoberfest. Just in case anyone else planned to pick up this issue.