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

Saved S3 assets not persisting when editing entry in CP (2.5.8+) #1406

Open
jeffmckeand opened this Issue May 4, 2017 · 10 comments

Comments

Projects
None yet
3 participants
@jeffmckeand

jeffmckeand commented May 4, 2017

Expected behaviour

Previously selected/saved S3 asset(s)1 should appear in asset field when going back to edit an entry in the CP.

Actual behaviour

Previously selected/saved S3 asset(s) do not persist within the asset field when reopening an entry where they were saved. UI assumes the field is empty and deletes the key:value on CP save.

Note: A rollback to 2.5.7 alleviates the issue.

Steps to reproduce

  1. Add an S3 asset to an asset field
  2. Save entry
  3. Re-open entry and see asset field is blank, even though the value is saved in the markdown file
  4. Save entry and see that the field is assumed to be empty, therefore deleted from the markdown file

Server Details

Operating System: macOS Sierra2

Web Server:: Apache 2.4

PHP Version: 7.1.4

Statamic Version: Confirmed on 2.5.8 & 2.5.9

Updated from an older Statamic or fresh install: update from 2.5.7

List of installed addons:

  • Google Maps
  • Location
  • SVG Output
  • Taxonomy Slug Filter
  • Tel

1. Doesn't appear to affect assets stored in a local container.
2. This isn't isolated to my local dev environment. It's also happening on my Forge/DigitalOcean production server running NGINX and PHP 7.1.2.

@jeffmckeand

This comment has been minimized.

jeffmckeand commented Sep 25, 2017

@jasonvarga FYI, this issue popped back up for me with 2.6.0+ :/

@jeffmckeand

This comment has been minimized.

jeffmckeand commented Oct 19, 2017

Still an issue in 2.7.0

@jeffmckeand

This comment has been minimized.

jeffmckeand commented Oct 19, 2017

Interesting that it was "fixed" in 2.5.10, but reappeared in subsequent releases. Any ideas for a temporary fix? I couldn't figure it out from a cursory scan of changes from 2.5.9 to 2.5.10.

@jeffmckeand

This comment has been minimized.

jeffmckeand commented Oct 24, 2017

@jackmcdade @jasonvarga This bug is turning into a real deal-breaker. I can't move my client's larger assets (mainly videos) off of S3, so I can't upgrade beyond 2.5.11, blocking me from some much-needed features in recent releases.

@statamic statamic deleted a comment from jeffmckeand Nov 3, 2017

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Nov 7, 2017

What exactly is the issue? I can't replicate any problems. Can you show an example of what gets saved to the file?

@jeffmckeand

This comment has been minimized.

jeffmckeand commented Nov 7, 2017

Sure. I'll put together a more detailed example later with some screen caps , but here's the fullest explanation of the problem I can give at the moment:

I have a collection with multiple single-asset fields pointing to an S3 asset container. An author goes in and adds an entry with new assets, saves, and the .md file is created with correct values for those asset fields. No problem.

However, on certain versions of Statamic (basically anything after 2.5.11), if a user opens one of those entries in the CP, those asset fields are completely blank. The values are stored correctly in the .md file, but they don't make it back to the corresponding Vue elements. So if something in another field is changed -- let's say a quick copy update -- and the entry is saved, those asset fields now save as empty because the Vue elements don't have any value assigned to them. Data is essentially erased, and content disappears.

No errors are reported to logs, and there are no errors in the console or Vue developer tools. I'm stumped.

The issue first showed up for me in 2.5.8. Based on the history of this issue, it appears you fixed it in a May release (2.5.10?), but then it reappeared in 2.5.12 and above.

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Nov 7, 2017

Cool. If you can provide an example of what is saved in the file, that could help. Also, your asset container yaml file (without your credentials).

@jeffmckeand

This comment has been minimized.

jeffmckeand commented Nov 7, 2017

Of course. Thanks for taking a look at this again. Apologies for being a pest :)

@jeffmckeand

This comment has been minimized.

jeffmckeand commented Jul 19, 2018

Months later, a potentially facepalm-worthy update:

After taking a break from maintaining the site in question, today I took a look at how the Asset field was saving data to each entry's MD file. At some point, it seems Statamic's preferred format for S3 URLs changed from https://s3.amazonaws.com/bucketname/... to https://bucketname.s3.amazonaws.com/.... Now that all of those references are fixed in my site content, everything seems to be working fine. Asset fields pointed to S3 buckets are populating correctly when opening entries to edit.

Not sure if I missed something in release notes along the way. 🤷‍♂️ 🤦‍♂️

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Jul 19, 2018

Hmm...I wonder if it was the Flysystem package that changed...

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