New answers tagged


I did with javascript because the field type media_library is not an actual input field. I overrided the setMediaUploadFieldValue jQuery function of the media_library_form_element module. (($, Drupal) => { Drupal.behaviors.VideoComponent = { attach: () => { $.fn.setMediaUploadFieldValue = (data, element) => { const mediaElement = ...


In response to your second question, there is a core issue open regarding editing media items within the field widget: There is also a contrib module Media Library Edit. One problem is that you will edit the media entity itself, affecting all usages of the media item.


but node is null since this is not on a node In user template there is {{ user }} variable wich holds user entity. So just replace "node" with "user" in your snippets.


You can upload images and create media without the File Entity module and any module fixes. Try this: New "file_upload" REST resource plugin: allows file uploads of any size, creates File entities In your case, the request would be like this: POST /file/upload/media/image/field_media_image?_format=hal_json HTTP/1.1 Content-Type: application/octet-...

Top 50 recent answers are included