Slide image gets uploaded as thumbnail

steven2358's picture
steven2358
Thu, 06/26/2014 - 15:13
#1
Slide image gets uploaded as thumbnail

I want to create a full-width slider with a background image, such as this one: http://demo.symphonythemes.com/drupal7/velocity/

Here's what I'm doing:
1. In the editor, I go to my slide and press [Settings].
2. I press [Choose image] and upload a large (wide) image. It then appears in the Slide setting window.
3. I press save.
4. If I press [Settings] again the image appears now under the [Choose thumbnail] button. This does not seem correct.

The image does not appear on the slide at this point. It does not appear in the slideshow either, but if I hover over the bullets I can see the image I uploaded as a thumbnail.

Is this a bug or am I doing something wrong?

steven2358's picture
steven2358
Thu, 06/26/2014 - 15:17

PS: In the javascript console I get this error on loading the Edit screen:

Resource interpreted as Image but transferred with MIME type text/html: "www.myweb.com/admin/structure/md-slider/1/undefined". (md-slider-panel.js?n7sbxh:7)

steven2358's picture
steven2358
Fri, 06/27/2014 - 02:46

Okay, I tried my dev skills. I found and fixed the bug. It was in the file md-slider-panel.js.

Hint: e(".slide-choose-image-link, .slide-choose-thumbnail-link") is a big no no. Better split it up.

Guicom's picture
Guicom
Sat, 06/28/2014 - 03:13

Hello Steven,

I have the same problem. How do you exactly fix it ? (my dev skylls aren't high...)

steven2358's picture
steven2358
Sat, 06/28/2014 - 05:44

Sure. In md-slider-panel.js you need to replace the following string

e(".slide-choose-image-link, .slide-choose-thumbnail-link").live("click",function(){var t=e(this);Drupal.media.popups.mediaBrowser(function(n){var r=n[0];Drupal.settings.select_image=r;e("#slide-thumbnail").val(r.fid);e("img",t.next()).attr("src",r.url);t.next().show()})});

by this:


e(".slide-choose-image-link").live("click",function(){
var t=e(this);
Drupal.media.popups.mediaBrowser(function(n){
var r=n[0];
Drupal.settings.select_image=r;
e("#slide-backgroundimage").val(r.fid);
e("img",t.next()).attr("src",r.url);
t.next().show()
})
});
e(".slide-choose-thumbnail-link").live("click",function(){
var t=e(this);
Drupal.media.popups.mediaBrowser(function(n){
var r=n[0];
Drupal.settings.select_image=r;
e("#slide-thumbnail").val(r.fid);
e("img",t.next()).attr("src",r.url);
t.next().show()
})
});

robbdavis's picture
robbdavis
Sat, 06/28/2014 - 13:51

Steven, nice work! Your code saved me.

Devs, this was also a major problem for me in version 2.12. The main images were not being set properly through "settings". I suggest you add this fix ASAP as most people aren't going to be able to go in and change the code themselves.

Guicom's picture
Guicom
Sat, 06/28/2014 - 16:09

Thank you Steven, you save me too :)

Agree with rabbdavis. A patch must be release.

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.