statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

Don't trash meta data (alt) when replacing an asset #925

Open robdekort opened 1 year ago

robdekort commented 1 year ago

Bug description

When you replace an asset (amazing feature btw), you loose any data entered in the blueprint fields like alt text.

Note: This does not happen when reuploading an asset.

How to reproduce

  1. Upload an asset.
  2. Set an alt text.
  3. Replace the asset with another file.
  4. Open the asset.
  5. Be like: "Hey! Where's my alt text?"

Logs

No response

Environment

Environment
Application Name: Statamic Peak
Laravel Version: 9.43.0
PHP Version: 8.1.10
Composer Version: 2.2.7
Environment: local
Debug Mode: ENABLED
URL: statamic-peak-dev.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 1
Antlers: runtime
Version: 3.3.60 PRO

Statamic Addons
studio1902/statamic-peak-commands: 1.1

Installation

Starter Kit using via CLI

Antlers Parser

runtime (new)

Additional details

No response

jasonvarga commented 1 year ago

Expected. When you replace an asset, you're replacing it with a new asset.

When you reupload an asset, it's considered the same one so you keep the data.

robdekort commented 1 year ago

Hmmmm that feels a bit short sighted. It makes so much sense to replace an asset with a similar, final or higher quality one. Just trashing some alt text doesn't seem like sane intended behaviour that is helpful to me.

I mean you even suggest to use the replace feature instead of reuploading in the CP: You may encounter browser or server-level caching issues. You may prefer to replace the asset instead.