pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

For single file field, "Add File" should say "Replace File" and hebavior needs update accordingly #7120

Open heybran opened 1 year ago

heybran commented 1 year ago

Description

For single file field, Add File should say Replace File and hebavior needs update accordingly.

As discussed on Slack, the way it works now is that it's just attempting to add the additional file but it has hit the limit so newly added file won't be shown, we should update Add File to Replace File and update button function to replace file as well.

Version

2.9.19

Screenshots / Screencast

Screenshot 2023-07-17 at 23 08 57
JoryHogeveen commented 1 year ago

I believe this is a field setting, you can set your own label in the field advanced options.

sc0ttkclark commented 10 months ago

This is really tough because the file field needs a full refactor. It's currently in an in-between state because we tried to save money in our original React revamp for Pods 2.8.

It's got a Marionette adapter sitting on top of the React field and the logic is really difficult to rework.

As it stands, if we change how this works for 'Single' file fields to replace the existing value, that may be confusing since 'Multiple' file fields won't have that ability. So for 'Single', if we used 'Replace' then 'Multiple' would have a different interaction there.

heybran commented 3 months ago

Hey @sc0ttkclark

I've sent a small improvement PR for this issue: https://github.com/pods-framework/pods/pull/7315, although didn't really refactor the logic to make the All file to replace original file if it's a single file field, but what I did is to hide the button when an file is being added already, so in my opinion that would be better than current behavior. What do you think?