Originally this issue started as an unrelated support request, however a patch was written by Gribnif and it needs to be reviewed.

TODO: review the patch by Gribnif. This patch pertains to code for the security advisory, when we brought in a blacklist to prevent sensitive items from being tampered and improved it with a whitelist, looks like some of the blacklist code artifacts were left over. The patch appears to clean up most of it. More time is needed for review of these though.

Recently we upgrade both an intranet and internet site for Siskiyou County. When I installed the update the ability to upload disappeared from the media browser. At this time there is no way I can add documents to the site. I don't know how to add a photo or image here, but the FILE field says Attach Media with a little Browse Capsule.

When you click the Browse capsule, You only have the option File URL or media resource and a box. This gives my know way to upload. There are WEB LIBRARY MY FILES tabs across the right top of the Media Browser.

I can find no way how to input media into the site. Even if I just copy them to that location on the server using winSCP. the file is not located in either my Files or the Library.

I'm far from being an expert in Drupal, but have been able to get along fairly well using modules and more simplistic stuff. Have used media for a number of years and this only happened with the recent upgrades. Am I missing something or is there a problem with the way it installed on my sites.

Sorry I didn't know where else to turn with this issue. Thanks for any guidance you can give me. I am a registered user. JudyAC.

Comments

JudyAC created an issue. See original summary.

joseph.olstad’s picture

I suspect a problem with your filesystem.

I recommend deleting the media module folder and all files inside the media folder
then re-copy the 7.x-2.3 media module files over to your server

Once you've done that , run the duplicate module finder module, you might have more than one copy of media in your system, seems wierd.
https://www.drupal.org/project/dmf

use dmf to find duplicate copies of modules, it could be that you have two copies , and perhaps an olderer duplicate is still lurking in the filesystem causing a conflict.

Also, are you running media_ckeditor with ckeditor ? or wysiwyg with another type of editor or ckeditor?
are you using a cdn (hyperlink to the editor libraries) or a copy of the library on your filesystem?

aside from this, have you checked the recipe ? its for media_ckeditor , however wysiwyg works in it's place as well, the configuration is different between media_ckeditor and wysiwyg , but not too hard, and similar at the same time.

isinadinos’s picture

I am also facing issues after upgrade. Did you see the logs? When I open the media browser i get

/media/browser?render=media-popup&options=nWi50YXM6WMZLOvUr2LdrIqi5l9QBQPZe6pWDDCWyGo&plugins=undefined

Exception: Error Processing Request. (Error: 404, Not Found) στην MediaYouTubeStreamWrapper->getOriginalThumbnailPath() (γραμμή 31 του /var/www/vhosts/arcadiap/sites/all/modules/media_youtube/includes/MediaYouTubeStreamWrapper.inc).

joseph.olstad’s picture

Component: Media Browser » Code
Category: Support request » Bug report
Status: Active » Needs work

The error description shows plugins=undefined , I am wondering which is the most recent version of media in which this worked?
For security reasons media now expects these parameters to be stored in a variable and retrieved by a key. Looks like
we may also need to implement the whitelist and options filtering in media_youtube as well , or figure out how to get it to play nice.

As a temporary workaround try the 7.x-2.0 release which uses a blacklist instead of a whitelist and let me know if this issue occurs on that release.
sounds like you're using media_youtube and its MediaYouTubeStreamWrapper in combination with the media module.

we likely need to have a closer look at media_youtube

JudyAC’s picture

Joseph, I hope I am putting my comments in the right spot. This is the first time I've works with someone on a module issue. So forfive me if this is not the best place to get your continued help.

At your suggestion this afternoon we removed the Media module folder and copied a new fresh copy of Media 7.x-2 again. We have the same results as we had prior to changing out Media. only see the Library and My Files and no way to add new files.

I have not tried to go back to the older version of media, but will do that just as soon as I'm through writing this.

We use CKEditor 7.x 1.17 and have Wysiwyg turned off. I did not use recipe and just now looked at it for the first time. Seems a bit over my head, but might be able to figure it out. One other thing that I didn't mention is that most of our "stuff" that is PDF files are contained in field collections because we have lots of similar things like on this intranet we have policy and form collections that have a great number of files and similarly on our internet that has the same problem with the new Media Module we have large groups of agenda, procedures, forms, policies, etc. Do you think that might led a piece to the puzzle?

I'll report back after I revert to the older media version. Thanks for trying to help me from a distance. Judy

JudyAC’s picture

I just tried installing three older versions stopping with.2 and I can install from none of them. So the whole process has broken down. Thanks for any ideas you can give us Joseph. Judy at 4:35pm Momday

joseph.olstad’s picture

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

Judy, Sorry telephone malfunction,

What is the most recent version of media that worked for you? Was it a 2.x or 1.x ?
Have you looked at
#2082037: Document Upgrade Path from Media 1.x to Media 2.x/3.x

joseph.olstad’s picture

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

Judy, I hope you have a database backup. Makes it easier to repeat the upgrade or to back it off.
If not then please provide necessary details as required.

joseph.olstad’s picture

Judy, in the instructions it is mentioned to review the file entity permissions, it is possible that your user / role needs permission adjustments for creating adding and viewing files (file_entity permissions)

joseph.olstad’s picture

Judy, please review my comment #11 , it is probably a very simple fix, adjust permissions for the roles that you want to add files.

joseph.olstad’s picture

Status: Active » Postponed (maintainer needs more info)
gribnif’s picture

It seems that Drupal.media.openBrowser() in media.js is calling Drupal.media.popups.mediaBrowser() with too few parameters. That's the reason for the "plugins=undefined". I'm not sure what change would get the plugins list to be included, though, considering that event.data.configuration.global contains only the "options" element and nothing else.

gribnif’s picture

StatusFileSize
new790 bytes

It looks like there is a disconnect between media.js, which is still trying to send values as GET parameters on the URL, and media.module which is storing all of the parameters in a cache and sending only the cache ID. Data is being read from the cache, but it's getting overridden with the garbage values coming from the GET parameters. I think the cached values should be used exclusively, if they exist. See the attached patch.

gribnif’s picture

Status: Postponed (maintainer needs more info) » Needs review
JudyAC’s picture

Joseph. I believe that the most current version that worked was 7.x-2.x, but not sure just when it broke. I know it worked the first part of April as I did a number of policy updates at that time. I hadn't read the document you mention so just did. There must be something broken in php. on my sites. Should I be updating php don't think I've done that but there must be something broke in it. Other suggestions are appreciated. How to proceed suggestions would be wonderful. Thanks, Judy

JudyAC’s picture

It likely broke the last week of April because I know I did a security update then and it was for media and then I was unable to update documents after that. I'll try to figure out how to update PHP. Judy

JudyAC’s picture

Joseph, your comment number 11 was the issue and solution. As soon as I set permissions on File Entity uploading worked like a charm. You must have added the File Entity connection during one of latest upgrades to Media and I hadn't set the permissions from ages ago on File Entity, but it only started needing it recently.

Thanks ever so much for your time and help on this issue. It has been a frustration for me! Judy

joseph.olstad’s picture

Hi Judy, great to hear that you're back up and running.

To run the schema updates (update.php) you visit

http://myDrupal7site.example/update.php

this updates the database schema if there's any new module hook_update to run. it is explained in greater detail here: #2082037: Document Upgrade Path from Media 1.x to Media 2.x/3.x

joseph.olstad’s picture

@Gribnif , are you experiencing the same issue as Judy?

I will look at the test results of your patch either way (once they come in).

joseph.olstad’s picture

Title: Updated to 7.x-2.3 upon Update No Way to Add Document/Image » plugins=undefined cache overwritten by get parameters
Issue summary: View changes
joseph.olstad’s picture

Title: plugins=undefined cache overwritten by get parameters » plugins=undefined , likely get parameters that were already cached previously, but still show up, review patch
joseph.olstad’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

I've reviewed this and tested this change. My tests show that it works.

However this section of code is a bit cryptic (I prefer simpler logic structures, some times && !== and = in the same if statement overloads my analog php interpretter.

put this into 7.x-3.x first.

I think it's good for 7.x-2.x as well, but holding off just to have a bit more time and more reviews.

  • joseph.olstad committed 9f95d03 on 7.x-3.x authored by Gribnif
    Issue #2879976 by Gribnif: plugins=undefined , likely get parameters...
joseph.olstad’s picture

Status: Needs review » Fixed

fixed for 7.x-3.x

joseph.olstad’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Status: Fixed » Needs review

now assigning to 7.x-2.x

joseph.olstad’s picture

Issue tags: +minor version target
joseph.olstad’s picture

Assigned: Unassigned » joseph.olstad
joseph.olstad’s picture

Status: Needs review » Fixed

This was just merged into 7.x-2.x and is included in release 7.x-2.6

  • joseph.olstad committed 9f95d03 on 7.x-2.x authored by Gribnif
    Issue #2879976 by Gribnif: plugins=undefined , likely get parameters...
joseph.olstad’s picture

Issue tags: -minor version target

Status: Fixed » Closed (fixed)

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