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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
1answer
19 views

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

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
27 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
39 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
87 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
18 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
14 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 ...
-1
votes
0answers
16 views

How to embed media in Drupal Commons

Using Drupal Commons-7.x-3.46.. I'd like to allow users to embed media in a post just by pasting a link into the body of a post, i.e. without buttons or widgets. This seems to have become quite ...
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
39 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
21 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
56 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
29 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
16 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 `#...
2
votes
0answers
37 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
33 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
12 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
98 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
23 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
25 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
85 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
18 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.
1
vote
1answer
116 views

D8: 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
37 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
13 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
99 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
21 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
92 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
55 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
238 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
25 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
81 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
52 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
13 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
102 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
123 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 ...
1
vote
1answer
104 views

Migrate media with alternative text

I'm trying to import image with new media module on core 8.5. I've a json source and on my .yml I've: field_media_image: target_id: plugin: migration migration: immagini ...
0
votes
1answer
142 views

8.4 - Use entity browser in a module block from in same way as I would in a custom block

I am having trouble adding an image picker to a block form defined in a custom module. If I create a custom block type I can define an image field as entity_reference and in the block's form view ...
0
votes
0answers
9 views

How to display all media that references this taxonomy term and all its descendents?

There is a way to display all media that references a taxonomy term and its immediate children, however how can I display all media that references this taxonomy term and all its descendents? ...
0
votes
1answer
63 views

How to hide the label of a entity referenced image field

I am using drupal core 8.4.2 and lightning 8.x-2.23. I have a entity referenced image field that I am printing out like this {{ content.field_main_image_2.0 }}. I think there was a change starting in ...
0
votes
0answers
231 views

Uploading an image shows JS error: Refused to display XXX in a frame because it set 'X-Frame-Options' to 'deny'

Using Drupal 7, our media browser stopped working on a clients site. They are using the media browser to upload an image to a product, but when they click upload they get a blank media browser modal. ...
0
votes
1answer
174 views

How can I dynamically get the fields on an image media bundle?

What’s the correct way to get all of the key/values for a bundle on a media entity? I am trying to create a media entity programmatically and I need to get all of the fields on the image bundle. I ...
0
votes
0answers
162 views

Drush Command “mecu” is not defined

I'm working through this media_entity upgrade as defined in FAQ - Transition from Media Entity to Media in core. The article 'strongly recommends' running the 'drush mecu' command. I'm using Lando ...
0
votes
1answer
48 views

How to properly use media (in core)?

We are converting all of our images to the image type provided by media. What I don't really understand is that there seem to be multiple ways to do this. Am I supposed to give the 'image' media ...
-1
votes
2answers
156 views

How do I integrate a Media library to Image Field?

I have a image upload element field in my content type. I need to open a media library when I click on browse. My expectation is to select an image which I have already uploaded before. So I don't ...
1
vote
2answers
73 views

Setting up a grid to carousel?

Alright everyone, I'm sure this is a relatively simple thing, but I'm on the verge of tearing my hair out. What I'm trying to accomplish is setting up images to appear in a grid, that when clicked ...
0
votes
1answer
286 views

How do I delete files attached with media entity in drupal 8.4.2?

Background: drupal 8.4.2 custom media solution Issue I can not delete files permanently which created as media entity. Reproduce Created an image media entity. /admin/content/files claims status ...
0
votes
1answer
114 views

How to display all media that references this taxonomy term and its immediate children?

I have a hierarchical taxonomy vocabulary, "Living Things". A simplified excerpt looks like this: Plants --Roses ----Red Rose ----Pink Rose --Orchids ----White Orchid ----Yellow Orchid I have a ...
0
votes
1answer
24 views

Rules (not) triggered with Bulk Media Upload

Rules (not) triggered with Bulk Media Upload I have a node type called 'uploads' that includes a user reference field to make each upload particular/available to a certain user. I have added a rule ...