In reference to this comment: https://www.drupal.org/project/media/issues/2496461#comment-12085904

Need the same code to exist in Media CKEditor. Have created a patch that performs the same alter as comment #11 in Issue 2496461, and it resolves the issue.

Please review the attached, thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ron_s created an issue. See original summary.

joseph.olstad’s picture

ron_s , I'm confused by this patch, if the referenced patch for media works, then why this patch?

I'm the maintainer for both media and media_ckeditor.

ron_s’s picture

Joseph, haven't investigated it deeply, but the media_wysiwyg_file_displays_alter function is never run when using Media CKEditor.

Maybe has something to do with our configuration, but tested it many times and was clearly running through media_ckeditor when performing placement of the file into CKEditor.

ron_s’s picture

Status: Needs review » Closed (won't fix)

I just checked something out, and you're right. The patch on #2496461 does work. I know what the issue was, and need to open a ticket in the File Entity module about this.

We had several file displays with Picture selected as the primary choice and Image as a fall back. By default, File Entity shows the priority sorting as "Picture", followed by "Image." The problem is both options have a weight of "0", so even though Picture is listed first, according to default alphabetical sorting Image is actually first. Even with your patch, we couldn't get anything to render as a Picture.

The File Display weights were manually set and around the same time we created the patch for Media CKEditor, and I think that is where the confusion existed.

ron_s’s picture

Posting a link to the issue I just added and mentioned in #4: https://www.drupal.org/project/file_entity/issues/2939338

slippast’s picture

I'm not sure if I'm 100% on the same page with this problem, but I'm pretty sure I'm experiencing it as well. Basically, when I add an image via the media browser it always gives me the generic image icon and image title when I have Picture as my only display style in the Manage File Display screen.

What I have to contribute is that I've been stuck using Media 2.13 since its release because this problem started in 2.14. Prior to that version this worked perfectly. Images display in the Media Browser and the CKEditor as expected, they include the image crops that I've defined in the Manage File Display screen. On the front-end the images display as expected and are reloaded responsively via the Picture/Breakpoints modules.

I'm able to use the following combination of modules without issue: Media 2.13 and current versions of Media_CKEditor, Picture, and File Entity. So while there are a lot of moving parts to this issue, I can say with some certainty that this issue was likely introduced in version 2.14.

I tried the patch that ron_s created and it appears to worked if I turn on both Image and Picture in the Manage File Display. But that also appears to break the responsive display on the front end.

I don't know if my comment adds much, but it might provide a clue. Thanks for your efforts on this issue!

joseph.olstad’s picture

Project: Media CKEditor » D7 Media
Version: 7.x-2.x-dev » 7.x-2.16
Status: Closed (won't fix) » Needs work

Did you try 2.16?

ron_s’s picture

@slippast, I'm no longer having any issues since upgrading to the most recent version of Media 2.x.

I have both Image and Picture in the Managed File Display, and when viewing in CKEditor, it shows a basic image, and when viewing the node, it renders that same image correctly as a responsive picture.

Are your weights set correctly in Managed File Display? Might also want to take a look at the issue I mentioned in comment #5.

joseph.olstad’s picture

Category: Bug report » Support request
Status: Needs work » Fixed

no response, assume this is working.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.