Support for Media-2.x and jquery_update

asantiago's picture
asantiago
Wed, 03/19/2014 - 00:14
#1
Support for Media-2.x and jquery_update

I'm using the following:

Drupal-7.26
Media-7.x-2.0-alpha3+75-dev (Latest dev of Media-7.x-2.0)

Here are the errors:

Warning: include_once(sites/all/modules/contrib/media/wysiwyg_plugins/media.inc) [function.include-once]: failed to open stream: No such file or directory in md_slider_edit_form() (line 450 of /home/beta/public_html/sites/all/modules/contrib/md_slider/includes/md_slider.admin.inc).

I modified the md_slider.admin.inc @ line 450:

include_once drupal_get_path('module', 'media') . '/includes/media.browser.inc';
media_browser_js();

I'm not a dev, just a themer but we probably need some logic to check which version of media has been installed...

Once i did this i was able to get to the edit screen. Now I'm experiencing javascript errors when attempting to change the images.

Uncaught TypeError: Cannot read property 'popups' of undefined

Looks like it's related to jquery_update however this is a dependency for other modules I have installed. Do you have a fix for this, I'd be more than happy to test for you :)

-Andrew

ACG - Drupal Development

cindy's picture
cindy
Fri, 03/21/2014 - 06:23

Hi,
Firstly, thanks for your concern in our product ad sorry for replying late.
We do not support dev, only alpha3.
About jQuery update, you can see the reference here http://megadrupal.com/forum/module-support/mega-menu/142

bdombro's picture
bdombro
Thu, 10/16/2014 - 13:57

@asantiago's fix worked for me for media-7.x-2.0-alpha4.

Also, contrary to what @cindy said, I would think this fix is also required for alpha3.

bdombro's picture
bdombro
Mon, 10/20/2014 - 10:01

Actually, @asantiago's fix did not work for me: it does not load all of the required js files for media. I created a patch which is working, and the source code is below. Patch works with media 2 alpha4 I recommend md_slider refer to this patch to make a fix in the next revision.

<start patch>

diff -rupN md_slider_orig/includes/md_slider.admin.inc md_slider/includes/md_slider.admin.inc
--- md_slider_orig/includes/md_slider.admin.inc 2014-10-18 16:33:16.000000000 -0400
+++ md_slider/includes/md_slider.admin.inc 2014-10-18 16:33:38.000000000 -0400
@@ -470,8 +470,8 @@ function theme_md_slider_overview($varia
*/
function md_slider_edit_form($form, &$form_state, $slid) {
$module_path = drupal_get_path('module', 'md_slider');
- include_once drupal_get_path('module', 'media') . '/wysiwyg_plugins/media.inc';
- media_include_browser_js();
+ include_once drupal_get_path('module', 'media_wysiwyg') . '/media_wysiwyg.module';
+ media_wysiwyg_include_browser_js();

drupal_add_library('system', 'ui.tabs');
drupal_add_library('system', 'ui.sortable');

<end patch>

cindy's picture
cindy
Tue, 10/21/2014 - 04:30

Hi,
Thank you very much for your feedback!
We fixed and sent the updated version of 2.15 for some customers who have trouble with media alpha 4
If you have any idea or suggestion, feel free to tell us. That will be much appreciated

Many thanks!

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.