Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
media system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Dec 2017 at 11:11 UTC
Updated:
3 Aug 2018 at 19:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
geek-merlinPatch flying in that might fix this.
Comment #3
berdirI don't think that is correct, you can't search or sort for that name then.
Maybe it could be updated but we would have to know that it was the default.
Comment #4
geek-merlinGood point. So we might need a setting for that, otherwise we can't discern a entered from a autogenerated name.
Comment #6
seanbTo fix this, we should be able to map the filename to a field. This would automatically update the media title and also allow users to hide the name field on the media form if the want to for #2882473: Hide the media name basefield from the entity form by default.
Having some issues running the new javascript tests locally, so hope this works.
Comment #7
phenaproximaComment #8
marcoscano+1
RTBCing in the assumption it will become green.
Thanks!
Comment #10
seanbStill having issues with my tests, hope this helps.
Comment #12
seanbPlease let this work...
Comment #14
seanbGetting close...
Comment #15
marcoscanoOnce now it's green, back to RTBC! :)
Comment #16
alexpottI think we have to do an upgrade path because media has been stable since 8.5.0 no?
Comment #17
marcoscanoMm, not sure I understand the need for the upgrade path. This patch exposes for the File, Image, Audio and Video source plugins the name of the file as a metadata attribute. This means that media types using these sources will now be able to use this new metadata attribute in the field mapping, if they want to. Once before the patch they didn't have this possibility, I'm not sure what the upgrade path should do?
Thanks!
Comment #18
alexpottSo then does this really solve the problem? As far as I can see, at the moment we use the filename as the default name and then the file entity can change its name and the media entity won't be updated. With this patch the site builder can enable the name mapping and then the name will be automatically updated. But how is a site builder going to know to do this. Shouldn't this be the default behaviour - and should this even really be configurable?
Comment #19
alexpottAnd what happens if you enable the mapping when entities already exist?
Comment #20
berdir> So then does this really solve the problem?
It doesn't need to, we have more than one issue. We have #2882473: Hide the media name basefield from the entity form by default for example, which will be about whether or not we want to have those fields hidden by default in our default media types in standard/umami. But even then, I don't think we should have an upgrade path. We don't have upgrade path for configuration changes in standard IMHO, we could notify sites about the possibility but should leave it to them if they want to do that. And certainly not enforce on all media types.
Comment #21
seanbMaybe this is more a feature request than a bug report. Since the name/title field is a special thing for entities, the way to solve this would be to automatically update the media name. I've updated the IS to better describe the problem and solution.
Since existing sites could depend on the media name NOT being automatically updated, I don't think this is something we should enable for existing sites. Existing sites could make use of this feature by adding the name mapping in the media type. We have #2882473: Hide the media name basefield from the entity form by default to discuss if we want to enable this for new sites by default.
*edit: Cross-posted with the last comments. Didn't mean to repeat points already mentioned.
Comment #23
marcoscano+1 for the reasoning above.
I've re-queued #14 against 8.7.x, and RTBCing under the assumption it will become green as well :)
Comment #25
marcoscanoNot sure about the failures in #14, seems like re-triggering them made it green... random failure?
Comment #26
alexpottOkay I see - so this is an addition. This seems useful so let's put it in 8.6.x too.
Committed and pushed a061dd7edd to 8.7.x and 147357e302 to 8.6.x. Thanks!
Comment #29
geek-merlin❤ Great it's already in!
Comment #30
alexpottI backported this to 8.6.x as improved media handling is important for Drupal 8 and the change, now I grok it better, feels very low risk.