After upgrading to 7.x-2.0 or later, including the 7.x-3.x alpha releases, I cannot upload new images via the wysiwyg, because after the select file/upload popup box the box goes completely blank.

By contrast, in 7.x-1.4 the popup goes straight from "upload" to "embedding", and after that the image appears in my content no problem.

This issue was originally opened a few weeks ago as https://www.drupal.org/node/2870795 but closed after apparently being found to be related to an issue with the localizejs module. My site does NOT have that module installed. I am unable to reopen that issue, hence this new one.

I have tested in both Chrome and Firefox and can reproduce this in both. I have also updated the WYSIWYG contrib module on my site as I noticed a comment on another ticket that an update to that had been released recently, but this hasn't solved the problem.

CommentFileSizeAuthor
media popup blank.jpg15.3 KBthoughtcat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thoughtcat created an issue. See original summary.

joseph.olstad’s picture

check watchdog for errors/notices/warnings that might be related
check browser error console for errors
make sure to upgrade the following modules:
token to latest version
wysiwyg to latest version
multiform to latest version
ctools to latest version

thoughtcat’s picture

Hi, thanks for the reply. All those modules are up to date (I don't have multiform). After trying to upload an image, I get about 15 log entries, all 404s, for various images on my site, along the lines of:

TYPE	page not found
DATE	Friday, 12 May 2017 - 4:32pm
USER	[my admin user]
LOCATION	http://www.mysite.org/sites/default/files/styles/square_thumbnail/public/040217%20025_lr.jpg?itok=u6VSEXyx
REFERRER	http://www.mysite.org/media/browser?render=media-popup&types=&activePlugins=&id=media_wysiwyg&plugins=undefined
MESSAGE	sites/default/files/styles/square_thumbnail/public/040217 025_lr.jpg
SEVERITY	warning
HOSTNAME	46.208.75.6
OPERATIONS	[blank]

Is that likely to be related? This wasn't the image I was trying to upload into the content, but as I say there are lots of entries for different images that don't seem to have anything to do with what I was doing yet do mention media_wysiwyg.

joseph.olstad’s picture

Just an FYI to anyone who may be updating their version of media, I recently experienced an issue with CKEditor immediately after updating to media 2.1, where it threw a javascript error stating it couldn't find a plugin element with name "media."

Reviewing all my CKEditor text-format settings at /admin/config/content/ckeditor/edit/ and resaving them seemed to fix the problem. I didn't change any settings, but it seemed that a key for a plugin file was renamed or misplaced or something.

Quoting a comment by Oranges13 (on the book page)

joseph.olstad’s picture

Status: Active » Needs review
thoughtcat’s picture

Thanks Joseph, I've just tried that (I'm using TinyMCE) but it hasn't made any difference.

joseph.olstad’s picture

any messages in the watchdog ?

joseph.olstad’s picture

hi @thoughtcat , are you using bulk upload? there was a regression in 7.x-2.1 that prevented the bulk upload from working, it has been fixed in release 7.x-2.2 and 7.x-3.0-alpha6 , just tagged

*EDIT* you already tried 7.x-2.0, so onto next clue: plugins=undefined we implemented a whitelist in 7.x-2.1 , try version 7.x-2.0 , see if it works, if it does, it could be that we need to add a way for you to whitelist perhaps a custom code bit that you're doing. a new hook could be created for that. Too early to say what it might be.

If you look at the browser network requests /urls and posts for the media browser, this will say what parameters you're requesting, could lead to more helpful debug info.

*EDIT* you already tried 7.x-2.0, so onto next clue: plugins=undefinedTry out 7.x-2.0 (before whitelist) or 7.x-2.2 (after whitelist and added bulk upload whitelist) or 7.x-3.0-alpha4 (before whitelist) or 7.x-3.0-alpha6 (after whitelist and added bulk upload whitelist), see if that helps

its tough to do all the regression testing for a SA release due to the secret nature of it, and looks like we have missed some test coverage in the simpletests.

please follow with regards to the clue

plugins=undefined

thanks.

joseph.olstad’s picture

Ok, I looked closer at your message above, I think this is the key we're looking for :

http://www.mysite.org/media/browser?render=media-popup&types=&activePlug...

it says plugins=undefined

there's some plugin that we may have to whitelist.

Please look into this further, as soon as we can , we will fix this, it may be due to some customization of yours, or maybe something we missed in the release.

thanks for your patience and comprehension.

joseph.olstad’s picture

Status: Needs review » Needs work
joseph.olstad’s picture

Status: Needs work » Needs review

@thoughtcat, can you please look into the parameter plugins=undefined ? This looks like perhaps a javascript issue, or it could be related to the new whitelist for url params that we put in, maybe you have custom params, or perhaps you need to try the new release 7.x-2.2 or 7.x-3.0-alpha6 (if using bulk upload you need the latest release as of today (sunday may 14th 2017).
also, be sure to clear all caches, and if you're using boost, clear those caches too, and to really give it a kick, restart your web service (apache or nginx or iis or other)

joseph.olstad’s picture

@thoughtcat , just FYI, I have tested these release with TinyMCE, and its working for me.

see if you can debug the plugins=undefined issue, I think it might be a caching issue, if you can clear all caches and boost or varnish caches if you're using that and restart your webserver, maybe that'll help? Not sure. You could also try changing jquery version using jQuery update. What version of jQuery are you using?

joseph.olstad’s picture

ALSO, make sure that you have the image style "square_thumbnail" , for some upgrades (for whatever reason) this image style needs either to be created or updated. It should be square dimensions, suggest 180px / 180px (width/height the same at 180px)

joseph.olstad’s picture

thoughtcat’s picture

Hi Joseph, many thanks for all the replies. I have updated to 7.x-2.2 and cleared caches without any change to the issue. I confirm that the image style square_thumbnail exists. Log messages after just testing adding images into content now say:

Notice: Undefined index: media in _token_field_info() (line 1334 of /home/mysite/public_html/sites/all/modules/token/token.tokens.inc).

Notice: Undefined index: module in FieldInfo->prepareInstanceDisplay() (line 628 of /home/mysite/public_html/modules/field/field.info.class.inc).

I don't know how to get more info for you on the undefined index issue.

I've also got:

User warning: The following module is missing from the file system: flag_terms. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1128 of /home/mysite/public_html/includes/bootstrap.inc).

I've had the latter error for ages (it comes up whenever I update any modules). The Flag Terms module is unsupported so I deleted it from my site some time ago. I doubt that error is related to the media one but should I reinstall Flag Terms anyway or is there some better way of getting rid of the error? Do I just manually delete the Flag Term module's table via phpMyAdmin?

thoughtcat’s picture

Re Varnish, thanks, I don't think I have that installed on my server but will check.

UPDATE: I confirm Varnish is not installed on my server.

steinmb’s picture

@thoughtcat any chance we could get a copy of your db. from before you did the upgrade? Having a hard time re-creating your problem.

joseph.olstad’s picture

@thoughtcat , please make sure to upgrade your token module to the latest release
also, what version of Drupal core are you using? 7.54?

joseph.olstad’s picture

Also, run the missing module fixer to fix the flag_terms issue, OR , restore the flag_terms module to your filesystem and uninstall it.

thoughtcat’s picture

Hi, I did have core 7.53 installed but just updated to 7.54 - no difference :-(

Token is up to date. Still getting this though:

Notice: Undefined index: media in _token_field_info() (line 1334 of /home/mysite/public_html/sites/all/modules/token/token.tokens.inc).

After updating core I got:

Notice: Undefined index: module in FieldInfo->prepareInstanceDisplay() (line 628 of /home/mysite/public_html/modules/field/field.info.class.inc).
Notice: Undefined index: module in FieldInfo->prepareInstanceDisplay() (line 628 of /home/mysite/public_html/modules/field/field.info.class.inc).

I have several other odd log messages now, still including the plugins=undefined one, but mostly about missing modules and themes, which aren't missing. Maybe my site has got corrupted somewhere. Should I try repairing the database via cPanel or something?

EDIT: I'm not expecting help on my general Drupal install etc - just thought I should repeat the messages I'm getting.

Thanks for the tip about the Missing Module Fixer - I didn't know it existed but I installed it and that message has gone away.

Not sure I can give you a copy of my entire database for security reasons.

thoughtcat’s picture

I've set up a completely new, vanilla site on the same server with 7.54 core and the most up to date versions of Media, Token and a few other essential contrib modules, done some basic configuration and can confirm that I have no problem uploading images there whether in a field or via the media browser in the wysiwyg.

I've also just updated Media on another site of mine (also on the same server) and have no problem there either. Token isn't even up to date on there, and core is two versions behind (7.52). I get the missing square_thumbnail issue on this site, so that when I upload an image via the image field I get a broken image placeholder in the submit form, and get a 404 in the logs for sites/files/styles/square_thumbnail/public/myimage.jpg, but that's all - it doesn't affect the display of the image in the content or corrupt the whole content upload process (no 500 error) in the way that I'm getting on the first site.

Media browser settings incidentally are exactly the same on all three sites.

I guess the site where I'm reporting these problems is just messed up :'-( All I can say is there isn't any custom code on there, but there are a hell of a lot of contrib modules. I suppose the only answer is to create a fresh install and use Migrate to recreate the site and hope for the best...

Thanks for all your help Joseph.

joseph.olstad’s picture

@thoughtcat , try this:

try disabling contrib modules on the broken site, one at a time, retest , isolate which contrib module /configuration is conflicting.

as for the square_thumbnail , go to /admin/config/media/image-styles and add it if it doesn't exist, 180px by 180px square scale/crop

thoughtcat’s picture

Thanks, will do :)

joseph.olstad’s picture

Status: Needs review » Postponed (maintainer needs more info)
joseph.olstad’s picture

FYI: media 7.x-2.3 was released today.

Gribnif’s picture

The reason for "plugins=undefined" is a bug in the JS code I documented here: https://www.drupal.org/node/2879976#comment-12099040

I don't think that's the real reason for this issue, though.

joseph.olstad’s picture

Status: Postponed (maintainer needs more info) » Needs review
joseph.olstad’s picture

Category: Bug report » Support request
thoughtcat’s picture

Joseph, thanks for the tip - I reviewed my file entity permissions and there were quite a lot unticked in fact, but even after ticking all of them for my role and clearing cache I still got the same problem.

My issue is about the media browser, but note I can't upload any images at all, even through a separate custom image file field. When submitting my page with a file "uploaded" via that field I get the 500 error. I'm not sure if that was clear. Does this help identify the source of the problem?

thoughtcat’s picture

Hi again... I haven't done a complete check against all the modules installed on my site but I have tried turning a few "likely" ones off and testing and none made any difference. I did think because of the 500 error that it could be something to do with directory permissions, i.e. the files weren't getting saved to my server properly, but I have checked and they are all actually being saved in sites/default/files. Not sure if that helps.

joseph.olstad’s picture

If u get wsod try enabling notices, I would paste how but my smartphone is dumb

steinmb’s picture

Status: Needs review » Postponed (maintainer needs more info)

For the error 500 you have to trace down the log entry telling you what went wrong. Without that information you are troubleshooting blindfolded.

joseph.olstad’s picture

Status: Postponed (maintainer needs more info) » Needs review

Gribnif comment above links to his patch, can u try it too?

joseph.olstad’s picture

Gribnif comment above links to his patch, can u try it too?

thoughtcat’s picture

@joseph, re #32, I've now updated to 7.x-2.3 and still getting "plugins undefined" in the logs:

location: http://www.mysite.com/admin_menu/flush-cache?token=_5231SDKIkaesXnvD080tIyrigmttwVbwIFm4MxSRwM&destination=node/add/article

referrer: http://www.mysite.com/media/browser?render=media-popup&types=&activePlugins=&id=media_wysiwyg&plugins=undefined

re #34, yes I tried that while still using 7.x-2.2 and it didn't solve the issue.

joseph.olstad’s picture

have a look at #2888472: Images shown as links
see if this gives you any ideas.

also, a new release was published today. 7.x-2.9
try it

also, turn on your debugging:
add this TEMPORARILY FOR DEBBUGGING purposes to your settings.php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
5t4rdu5t’s picture

To me this issue was due to the $group.inc files not being included therefore no plugins were loaded. I resolved it by updating views to the latest release 7.x-3.18, before I had 7.x-3.15.

joseph.olstad’s picture

Status: Needs review » Fixed

Seems like the originally reported issue is mitigated by recent versions of the views module.
If a similar issue should be reported again, feel free to open a new issue and link this one to it.

Status: Fixed » Closed (fixed)

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