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

Focal point not saved when blueprint has no fields #2954

Closed
marcusand opened this issue Dec 2, 2020 · 7 comments · Fixed by #6814
Closed

Focal point not saved when blueprint has no fields #2954

marcusand opened this issue Dec 2, 2020 · 7 comments · Fixed by #6814
Labels

Comments

@marcusand
Copy link

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
@duncanmcclean
Copy link
Member

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.

@marcusand
Copy link
Author

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?

@jasonvarga
Copy link
Member

Can you provide a repo with this problem reproduced?

@marcusand
Copy link
Author

@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.

@jackmcdade
Copy link
Member

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. 🕵️‍♀️

@joshuablum
Copy link
Member

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.

@ncla
Copy link
Contributor

ncla commented Sep 20, 2022

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.

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

Successfully merging a pull request may close this issue.

6 participants