After updating from wetkit 4.14 to 4.15 we noticed that when we add images in the WYSIWYG they get set with a size of 100 x 100 which make them look like thumbnails.

Steps to recreate:
- Create a new wetkit 4.14 site
- Update the site to wetkit 4.15
- Edit one of the existing nodes and in the WYSWIG click the media button and add a file.

Things I tried:
- reverting the wetkit_wysiwyg module and still had the problem.
- Doing a clean wetkit 4.15 install (no update) doesn't have the problem.

Since media went from version 2.0beta7 to 2.0-rc5 I cloned the module from git and the issue appears when I apply this commit: http://drupalcode.org/media/commit/?id=31e20ae

If I go to the previous commit, the image gets added with no width and height.

SOLUTION:

The solution is here:

#2856433: Update 7205 doesn't check if file view modes are enabled before migrating the configuration

However for those who have already updated and ran the hook_update_n for media before this week you might need to:

truncate table media_view_mode_wysiwyg;

or review your file type configurations (i.e.: admin/structure/file-types/manage/image/edit) and set the WYSIWYG view mode to none (or whatever value prior to upgrade).

Comments

natew created an issue. See original summary.

joseph.olstad’s picture

What options are you chosing when you insert the image to the wysiwyg editor?

Haven't seen any issues like this in the media queue, however sometimes the description might not match exactly. There's a few new RTBC issues in media this week, been pretty quiet since recent releases though, the media module has come a long way in the past 6 months. New feature adding align left right , and we're probably going to be adding an image css style feature as well to be optional overtop of the teaser and full modes.

I don't recommend going back to beta7 so lets try to figure this out asap.

joseph.olstad’s picture

Try this patch:
https://www.drupal.org/files/issues/only_one_view_mode-2308451-26.patch
***EDIT*** mentioned patch included in media 7.x-2.0-rc7

joseph.olstad’s picture

actually, might want to try the latest release of media 7.x-2.0-rc7.

There's some new commits in there including the patch I mentioned above.

Let us know if that helps thanks.

joseph.olstad’s picture

Hmm, this looks like the image style defaults in the wetkit distro might need changing or that the defaults are now incompatible with the newest versions of the media module.

If this is a media module issue then please open a new issue in the media queue if you cannot already find one that is already open.

sylus’s picture

It looks like this hook_update_n is not working properly. @nathan is going to show the exact reproduction case momentarily.

http://cgit.drupalcode.org/media/commit/?id=0e035bfd6aba4190be79df55d9f4...

Once we truncated media_view_mode_wysiwyg where everything was hard coded to wysiwyg everything worked.

sylus’s picture

Priority: Normal » Major
joseph.olstad’s picture

Ok, so what you're saying is if you revert that commit, the problem goes away?

joseph.olstad’s picture

sylus’s picture

don't need to revert just some slight logic needs to be corrected.

Nathan will be writing an update to the hook very soon. Something to do with it not respecting the status field. Patch and issue will be created shortly :)

joseph.olstad’s picture

A shot in the dark, is this by chance because square_thumbnail image style does not exist on your system after an install? Because on another system with media the square_thumbnail style was missing but for some reason media was looking for it. Once I manually created the square_thumbnail image style with scale to 180x180 then it worked nice. But that was the media browser , so not sure about this.

joseph.olstad’s picture

ok, thanks for the update, cool. The best patches are when someone else gives you one.

sylus’s picture

Issue summary: View changes
sylus’s picture

Issue summary: View changes
sylus’s picture

Issue summary: View changes
natew’s picture

This issue can be closed, could be useful to other people updating the distro and media. I opened an issue in media for this. https://www.drupal.org/node/2856433

Note that I am pretty sure this could also be fixed in the UI, by editing the file type, and setting the WYSIWYG view mode to none. eng/admin/structure/file-types/manage/image/edit

Would be nice if the recent releases of media were maybe less frequent and more stable, with more community review and testing.

sylus’s picture

Title: Media adds images with size 100 x 100 » Media Wyswiyg adds images with size 100 x 100 ignoring view modes
natew’s picture

Issue summary: View changes
joseph.olstad’s picture

media 7.x-2.0-rc8 was tagged with your fix. Thanks for your hard work. This hopefully is one of the last changes to the media module before 7.x-2.0 is tagged and released.

#2856433: Update 7205 doesn't check if file view modes are enabled before migrating the configuration

sylus’s picture

Status: Active » Fixed

Thanks a bunch! Updated to rc12 for media :)

fgjohnson’s picture

Question on process:

Media rc12 resolves this... So... Download Media rc12 overtop of wetkit v4.15?

Thanks for your work on this.

fgjohnson’s picture

natew,
I needed to make this change (WYSIWYG view mode to none) in the UI, even after updating to RC12.

  • sylus committed 777f481 on 7.x-4.x
    Fixed WetKit Widgets for Issue #2855850: Media Wyswiyg adds images with...
natew’s picture

@fgjohnson if you made the change in the UI, you shouldn't need to update media. The patch to media is only to allow for a cleaner upgrade path. If you went through the upgrade path and ran into the issue and fixed it manually, then you should be good.

Status: Fixed » Closed (fixed)

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

fgjohnson’s picture

Yes,
Thanks.
All is good.