Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Use it for questions about the module for managing files and multimedia assets: the Media module.

0
votes
0answers
16 views

Custom media library selection view

I'm trying to create a custom Media Library widget, to apply to only a specific media field. I'm using core Media (8.6) and not the contrib module. Basically I want a custom selection on media (...
0
votes
0answers
10 views

Issue using ‘explode’ and ‘migration_lookup’ plugins together

I’m new to migration, using migrate plus and migrate csv, I have some trouble mixing the ‘explode’ and ‘migration_lookup’ plugins. What I want is to add several media images to some media slideshow (...
0
votes
1answer
17 views

Can't import configs on server due to some entities

So when i try to manually import configs (/admin/config/development/configuration) i get these messages: Entities exist of type Media and Media type Image. These entities need to be deleted before ...
0
votes
0answers
13 views

How to add Filter by File extension in media Browser?

How do I add a filter by File extension in media Browser (not in file browser)? This filter lists all extension files existing in media.
0
votes
0answers
53 views

Contextual filter in media browser view not accessible on autocomplete filter ajax call

I'm having a view which filters Media type and has contextual filter of Entity browser context. This view also has an exposed filter of text box field with autocomplete enabled which filters by media ...
0
votes
0answers
9 views

how to view media revisions

hi I see that media revisions are now in the latest drupal version, and it looks like there is code to allow viewing the revisions for Media, but I cannot find the path or what has to be enabled to be ...
0
votes
1answer
27 views

How to display current pages the media entity is referenced during deletion?

We are using Media Entity module that provides a Document media bundle. On our Article content type, we have created an Entity Reference field to Media that is set to Document media bundle. When you ...
1
vote
0answers
148 views

How do I practically use the media library?

Now that Drupal 8.6 is released, I tried the experimental Media Library module. It works great, but it needs some additions. How can I use core Media Library with CKeditor? How can I fill custom ...
0
votes
0answers
12 views

Get URL from within modal

I'm using the Media Browser Plugin for Drupal 7 to allow users to upload content via a modal window when creating a new instance of a content type. The Media Browser shows several tabs (Uploads, ...
0
votes
1answer
62 views

Two step media creation form?

It would seem very logical to pick the media source first, and then have the field map mechanism fill in the fields based on the metadata the source entity provides via the media source plugin. I am ...
1
vote
0answers
58 views

How can I add classes to images added in CKEditor via Media?

Similar question to How to set width to Media entity image in CKEditor BUT I am trying to do more than insert various sizes of images, I want to add classes to the actual img tag. So when I insert an ...
0
votes
0answers
30 views

How do I migrate the name and file type?

I am trying to migrate external files to Drupal 8 Media files. I used the Migrate Files (extended) module to deal with the process plugins. The files were imported, but the name and the file type ...
0
votes
1answer
20 views

How to use (reference) the uploaded file to a media(video) type?

I have read https://www.drupal.org/node/2941420 and I can upload a image file then use it in article. But I can not use it as video field after I upload a video file. My Drupal version is 8.6.0-...
1
vote
1answer
43 views

How can I create multiple cropped Media images without re-uploading them?

Solutions that I've found allow to crop Media, type Image when I've uploaded an image, but the media entity is not yet created (on the "Add media" page). I need to upload a large full image once (and ...
1
vote
1answer
26 views

I am not able to override the form #access setting [closed]

I cerated a form alter with the file entity media upload browser. I studied this answer of how to alter this form. I then debugged and found that for what I wanted to do, I am in step 4 of the file ...
0
votes
2answers
69 views

How to get fields of media_entity?

We have a view that returns a Media_entity (Drupal\media_entity\Entity\Media) using the following in a hook_preprocess_view_views hook. When we try to access the field_media_type variable, I get a ...
-1
votes
2answers
87 views

How can I use media fied in a custom form in Drupal 8?

I tried something below, which is not working in drupal 8. $form['upload_documents'] = array( '#type' => 'media', '#tree' => TRUE, '#title' => t('Upload your documents'), '#...
2
votes
2answers
120 views

Display a Media Entity Image from other (referencing) node in a Twig template

Seems that all found in the Internet does not work for my case. :/ In general, I need to display an Image and a Project, referenced by the node that has a reference field to my node. I have: a node ...
0
votes
0answers
23 views

How do I get a direct download from a path like /media/<media id>?

i'm wondering how anyone using drupal 8 is handling files using the newly added to core media module. For example, uploading a document using media module, to be linked to by multiple pieces of ...
0
votes
1answer
19 views

Gray overlay and no dialog when clicking Image button in CKEditor

Attempting to get CKEditor and Media to work together on a Drupal7 site. Things are mostly working great, but when I click the regular Image button (or double-click an image, or use the context menu ...
0
votes
0answers
10 views

Media library: don't include profile pics or remove from library without deleting

Our site allows users to create a profile avatar. We are also using the media module, version 2.19, which includes a media library. The library is useful, however, all of our users' profile images ...
-2
votes
1answer
169 views

Custom migration: image fields to media [closed]

When migrating existing Drupal 7 fields, most things work. I need to convert images (using image upload) in Drupal 7 site to reusable media. Any help?
0
votes
0answers
28 views

Deploy Media Field Images From Staging to Production

I'm trying to find a way to copy nodes (plus associated images) and (ideally) users from a Drupal 7 staging site into production. In theory, this "Deploy - Content Staging" module is perfect: https:/...
0
votes
0answers
62 views

Link to a Media entity file from text editor

The idea is to create an hyperlink on some arbitrary text typed in CK Editor. That link should target a file uploaded to a Media file entity. Media entity download filter already makes it possible ...
0
votes
0answers
67 views

Change image paths from absolute to relative.

I have a Docker-Drupal 8 multi-site app in production, created by a third party, where every image uses an absolute path, so they get served from an unique server which makes the sites slower. Being ...
0
votes
0answers
10 views

How (if even possible) can I get a field value from an unsaved parent entity to use in a referenced entity?

I have two media types: Document (main) Name DocID Description Year Main file (file reference field) Supplemental files (optional, multi-value media reference field) Document (supplemental) Name ...
1
vote
1answer
17 views

How can I set the default value for a Media form element?

I am using Media 2.0 and a media field in a custom admin form. I am trying to set the default value as described on https://www.drupal.org/project/media/issues/1158760#comment-12656764, but `#...
3
votes
0answers
66 views

How to convert an existing D8 image field into a Media Image reference field?

I have an image field that I created before Drupal 8.5, when media was introduced in the ui. The field already contains content and I would like to make use of the reusable media functionality that is ...
1
vote
3answers
37 views

Rendering semantic HTML5 caption

Is there a way to render HTML5 captions in Drupal 8? I've tried with embedding images and embedding media in the WYSIWYG, and I've also tried with media migrated from D7 to D8, but nothing works. An ...
0
votes
0answers
17 views

Remove character limit for Caption on CKEditor with Media embed

I need to remove or overwrite the maxlength attribute for the caption (currently 128). There is another similar/identical question on this website, but the solution provided is not working. Is there ...
0
votes
1answer
161 views

Problems upgrading Media from 8.3 to 8.5

I have a Drupal 8.5.3 site (built from the composer project) that was previously on the 8.3 branch before the critical security updates forced me to update to 8.5. One of the things I missed in the ...
0
votes
0answers
43 views

Entity Browser Widget Validation

I am using Drupal Lightning 8.x.2.2.3. I want to restrict the file upload extension to only jpg , gif when uploading through the Ckeditor. I am using the Entity browser File Upload Widget. Currently ...
0
votes
0answers
41 views

Media browser Embed button does not restrict library to selected file entity bundles or Media type

I am using Drupal Lightning 8.x.2.2.3. And I am using the the built in Lightning Embed button (the one with the Star icon) added to the Ckeditor to add media to the body. The Embed button is using the ...
1
vote
1answer
152 views

How to convert the drupal-entity tag into an img tag?

I have a content type with a text field that uses CKEditor, in the editor is possible to add a media entity image, once the image is inserted inside the text the html tag for it is: <p>Document&...
0
votes
0answers
22 views

Is media _oembed in Drupal 8

The media_oembed page shows only D7 versions. Since media has been ported to Drupal 8, I was wondering if the module includes this functionality.
3
votes
1answer
299 views

Selecting an SVG as an Image Field value

I have a Content Type, News, with an Image Field, News Icon. When the field settings are viewed at /admin/structure/types/manage/news/fields/node.news.field_news_icon I have supplied SVG as one of ...
0
votes
0answers
45 views

Specify the widget type for a form field which doesn't have a related entity

We have a custom form with an image field and want to use the entity_browser widget from the File Entity Browser module, however it isn't displaying the uploaded content. The code we have so far: $...
0
votes
0answers
16 views

How to change look of entity browser

I've been trying to figure this out for hours but I can't change the layout of the entity browser to look like it should see below It always appears as follows - Am I missing something please?
0
votes
1answer
179 views

Media theme missing from the file system?

Not really sure about this error, I wasn't aware there was a media theme but could anyone help me understand this please? User warning: The following theme is missing from the file system: media in ...
0
votes
0answers
25 views

I don't have any media entity browsers in my installation, how to upload media

I am trying to create a field to browse and upload media in my paragraphs type such as images but I am struggling to create an entity browser that doesn't give me the error that what I am trying to ...
1
vote
1answer
93 views

Is media-7.x-1.x vulnerable to SA-CONTRIB-2018-020

The Drupal Media module version 7.x-2.x contains a remote code execution vulnerability which was patched with: https://cgit.drupalcode.org/media/commit/?id=1cd77ffa9c2cf96d80b76d47318179a8a82f0d46 1....
0
votes
1answer
17 views

Uploaded images classified as files rather than under the media tab

In Drupal 8 if you go to admin/content there is a tab for Files and a tab for media. I believe it is the media entity browser what distinguishes what area an uploaded file will be placed, but I could ...
0
votes
1answer
57 views

Add paragraph domains to media View

I'm using media and domain modules. Nodes are assigned to multiple domains and there are image fields that link to media images on those nodes. Some content types also use paragraphs and these ...
0
votes
1answer
424 views

drush updb fails with “the 'media_delete_action' plugin does not exist” after 8.4.6 > 8.5.1 update

We have recently updated a Drupal 8.4.6 installation via composer to Drupal 8.5.1. After the composer update I ran drush updb as usual. However, the command fails at one point with the following ...
0
votes
1answer
27 views

How to change the path in which are stored the media modules files and images?

When using media entity reference fields, is it possible to change the path where are stored the files and how? Is it possible to store them in the private folder?
0
votes
1answer
209 views

Getting the media URL in a views field

I'm using Drupal 8.5. I have a content type with the in-core media module. I'm making a view for content syndication, and I need one of the columns to be the FDQN URI to the media resource-- i.e, not ...
1
vote
1answer
54 views

Starting new 8.5 site is it safe to delete and reuse field_image field

I am starting a new 8.5 website and using the core media module. I want to know if it is safe to delete the field_image field from the Article content type and replace it with a field with the same ...
0
votes
0answers
18 views

How to override thumbnail generation of file type media?

In admin/content/media I need to show file type related icons instead of generic file icon. From this: To this: I tried to edit the related thumbnail field in "media" view but no option is present. ...
0
votes
1answer
251 views

programmatically attaching file to file media

I am trying to programmatically attach a file to a node, using the media module now included in core as of Drupal 8.5.0. I wrote this drush script to stub out the creation of a new file media ...
0
votes
0answers
152 views

Media module in core: add poster image to HTML5 videos

Drupal 8.5.0 with the media_module in core is bundled with four media types: audio, file, image and video. Let's create a content type with two fields: the field_local_video_file field which is ...