MIGX icon indicating copy to clipboard operation
MIGX copied to clipboard

Ajax Upload Not Working on SSL Site

Open nickff opened this issue 8 years ago • 8 comments

Hi Bruno,

So I recently realized that two sites on one of my servers are having issues with the Ajax upload feature all of a sudden. Everything is working fine other than the multi-upload, which was working not too long ago.

The folder is correctly created for each resource with the proper permissions, but when I open the multi-upload box there is no "upload files" button and I can't drag images into it (screenshot attached). I tried updating MIGX and MODX to the latest respective versions, but no luck.

blank-ajax-upload

Any ideas would be much appreciated!

nickff avatar Feb 22 '17 17:02 nickff

Also, here's a view of the console error being generated:

screen shot 2017-02-23 at 10 52 49 am

nickff avatar Feb 23 '17 15:02 nickff

So I've figured out that this is due to having installed an SSL certificate on the website. The call to http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js is not secure, so it's not loading.

The only reference I can find to this file is in "ajaxupload.html" which is in the core/packages/migx-2.9.6-pl/ folder. But when I update that to https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js the change isn't occurring and the error still appears (even after clearing core/cache and my browser cache etc).

Any thoughts on how to update that path to be secure would be much appreciated.

nickff avatar Feb 23 '17 18:02 nickff

I think the file is this one https://github.com/Bruno17/MIGX/blob/master/core/components/migx/templates/mgr/iframechunks/ajaxupload.html

Bruno17 avatar Feb 23 '17 19:02 Bruno17

Instead of requesting jquery over http you can use a relative protocol like //code.jquery.cdn

jpdevries avatar Feb 23 '17 20:02 jpdevries

Hi guys, thanks for the info.

Bruno, that's the file I updated and it's not making a difference. Any extra steps needed to make that change take effect other than edit then upload?

nickff avatar Feb 23 '17 21:02 nickff

@Bruno17 You're right - I was in core/packages/ rather than core/components/. Updating the path to jquery in that file fixed it.

Perhaps this is something you can implement in future versions, so manual editing is not necessary for HTTPS sites?

nickff avatar Feb 24 '17 15:02 nickff

@nickff Did you change it to a relative protocol, as suggested by jpdevries? which did work for you? Will change it in future versions, if I know its working for all protocols

Bruno17 avatar Feb 25 '17 11:02 Bruno17

I used the https protocol for the jquery path.

nickff avatar Feb 26 '17 01:02 nickff