Hi

after updating to some dev version. I'm not sure at what time it happened, but media browser became very slow.
url is:
/media/browser?render=media-popup&enabledPlugins%5Bupload%5D=upload&enabledPlugins%5Bmedia_default--media_browser_1%5D=media_default--media_browser_1&schemes%5Bpublic%5D=public&schemes%5Bvimeo%5D=0&schemes%5Byoutube%5D=0&file_directory=section_icons&file_extensions=png&max_filesize=&uri_scheme=public&min_resolution=36x36&max_resolution=36x36&plugins=undefined

load time is 1m 8s
and total size is 2.7mb

probably it is because of big size. as I see in respond probably biggest size is of this values in Drupal.settings:
"file_contents":"iVBORw0KGgoAAAANSUhEUgAAAMcAAAEICAIAAABkrndEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAP+lSURBVHhe7PxnVJTZt+4Nv1+e9z3n7N3dSk5FURQ555yjRCUJghJEQZLkLAYQc8

thanks ;)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MantasK’s picture

Category: Support request » Bug report
Status: Active » Needs review
FileSize
357 bytes

I found solution. I set "" to file content and it is not sent over ajax

steinmb’s picture

Title: media popup became very slow » Media browser loadtime high
jwilson3’s picture

Patch in #1 introduces trailing whitespace, and could use a comment.

joseph.olstad’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Assigned: Unassigned » joseph.olstad
joseph.olstad’s picture

Kristen Pol’s picture

+++ b/media.module
@@ -1176,6 +1176,9 @@ function media_file_displays_alter(&$displays, $file, $view_mode) {
+  $file->file_contents ='';

Nitpick: Should have a space after the equals sign.

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

OK, this is going in. Yes for the space thanks

  • joseph.olstad committed 798c096 on 7.x-2.x authored by jwilson3
    Issue #2165117 by MantasK, jwilson3, steinmb, Kristen Pol: Media browser...

  • joseph.olstad committed 4b3bd5a on 7.x-3.x authored by jwilson3
    Issue #2165117 by MantasK, jwilson3, steinmb, Kristen Pol: Media browser...

  • joseph.olstad committed cd23f23 on 7.x-4.x authored by jwilson3
    Issue #2165117 by MantasK, jwilson3, steinmb, Kristen Pol: Media browser...
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone. It is in dev now where it will simmer for a while.

Status: Fixed » Closed (fixed)

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

Christopher Riley’s picture

Is anyone else getting the following after adding this patch?

Warning: Creating default object from empty value in media_ctools_plugin_api() (line 1294 of /usr/home/sites/sitename/public_html/sites/all/modules/contrib/media/media.module).

I applied this patch to 7.2 while I try to diagnose losing my session when trying to upload while the bulk file uploaded is enabled. It seems with the patch things work however I now get those warnings.

joseph.olstad’s picture

Title: Media browser loadtime high » regression for fix to Media browser loadtime high
Status: Closed (fixed) » Active
joseph.olstad’s picture

Does anyone else get this warning message since patching?
Warning: Creating default object from empty value in media_ctools_plugin_api()

joseph.olstad’s picture

Status: Active » Fixed

I've been running php 7.2.x extensively with the media_dev distribution version 7.x-2.x dev which has this code and I haven't noticed this.

everything seems to work perfectly for me.

I've bulk imported over 10000 images and used plupload media_bulk_upload
it works for me.

steinmb’s picture

Works for me too. Not noticed the warning. Thank you for all your hard work.

Status: Fixed » Closed (fixed)

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