django-filer icon indicating copy to clipboard operation
django-filer copied to clipboard

Display name of filer on admin change view should match list view

Open jsma opened this issue 8 years ago • 6 comments

Currently in the admin change view for files, it is hard-coded to always display the original_filename.

This can be very confusing for editors who are often required to replace an outdated PDF, etc. If the displayed name is 'Cool brochure 2014.pdf' but the current file is the 'Cool brochure 2016.pdf' then they get very confused and think the old file is still in filer.

The admin list view uses the __str__ method to determine what to display, so the change view should match this.

Pull request on its way.

jsma avatar Nov 03 '16 00:11 jsma

#931 only fixes the hard-coded name in the template. However, why does filer only track the original filename and use that as the default display name? What's the point of the original_filename field other than this? Shouldn't it instead just track the current filename and default to that unless they've manually specified a name?

jsma avatar Nov 03 '16 00:11 jsma

@yakky should __str__ continue to default to the original_filename or should we track the current filename instead?

jsma avatar Nov 03 '16 17:11 jsma

@stefanfoulis @jsma it's maybe actually confusing keeping original_filename unchanged after uploading a new file @jsma I'd merge your current PR in 1.2.6 and let's figure out an optimal solution for this issue

yakky avatar Nov 06 '16 09:11 yakky

Should we discuss on the mailing list or what are next steps?

jsma avatar Nov 21 '16 06:11 jsma

The idea of original_filename was to have a reference to the originally uploaded filename and to have something to display whenever user do not provide a custom name. It is a separate field to be able to distinguish whether a user provided a custom name or left it unchanged. But that behaviour seems to currently be broken. If we keep original_filename around, we should update it whenever a new version of the file is uploaded and make sure it is used consistently (if a user provides a custom name, that should be displayed). Makes ordering harder though.

As @yakky wrote, it is debatable if keeping original_filename makes sense at all.

stefanfoulis avatar Nov 22 '16 08:11 stefanfoulis

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 28 '22 22:07 stale[bot]

This will now be closed due to inactivity, but feel free to reopen it.

stale[bot] avatar Aug 31 '22 00:08 stale[bot]