File history record not showing after updating class_for_file_extension
config
#676
Open
2 tasks done
class_for_file_extension
config
#676
Module version(s) affected
2.2.3
Description
Hi Team,
I am not 100% sure if my understanding of this is accurate or is this a legit bug.
On
File::get_class_for_file_extension()
, it saysCaution: Changes to mapping doesn't apply to existing file records in the database.
. My interpretation for this is that the current or existing file record properties should not change even after updating theclass_for_file_extension
config i.e. if the extension was previously supported bySilverStripe\Assets\Image
it should remain intact even after updating the extension to a new type sayModel\Image
. However, after updating this config, I could see that the version record for the existing file was updated to the new subclass.This creates an issue when viewing the history records for the (existing) file because it doesn't fetch the previous versions from the previous class. This is what I see on on
File_versions
table after updating the config. Previously, it wasSilverStripe\Assets\Image
but get updated toModel\Image
after changing the mapping config.I want to double check if this is the intention for this confirg or is this a bug?
How to reproduce
SilverStripe\Assets\Image
class_for_file_extension config
, make sure the extension is identical to the file uploaded e.g.png
Possible Solution
No possible solution in mind until there's clarity whether this is a bug or current expectation.
Additional Context
This could be related to a bug I reported on asset-admin, where a sub-class gets converted to a generic
File::class
. The difference is that the above converts existing record to a new class based on the new config mapping.Validations
silverstripe/installer
(with any code examples you've provided)The text was updated successfully, but these errors were encountered: