active_fedora
active_fedora copied to clipboard
File attributes not being tracked for changes
At least original_name
and mime_type
.
c.content.original_name => "dscsi010010020.tif" 2.1.5 :028 > c.content.original_name = "foo.tif" => "foo.tif" 2.1.5 :029 > c.content.changed? => false 2.1.5 :032 > c.content.changed_attributes => {}
I believe the root problem is that original_name
and mime_type
are not properties (RDF property accessors). IIRC this may go back to early days of FCR4 when this data was not being persisted as it is now (at least in v4.4+). We should be able to use the properties now, right?
> c.content.metadata.get_values(RDF::Vocab::EBUCore.hasMimeType)
=> ["image/jpeg"]
> c.content.metadata.get_values(RDF::Vocab::EBUCore.filename)
=> ["dcs.jpg"]
/cc @jcoyne @tpendragon @barmintor
I think the problem here is that these are headers when we first create the object, but then they become RDF properties on an existing object.
@jcoyne OK, so what's the fix? As now, we can't updated the properties AFAICT through the AF API (except I guess by changing the file content too).
I don't know how to fix it. I haven't had the time to think on it. I'm sure it will require some custom handling of those two attributes.
Reviving this issue, mime_type
is updatable now but original_name
is not.