codem / DisplayAnything3

File and image gallery module for SilverStripe3.0
BSD 3-Clause "New" or "Revised" License
12 stars 8 forks source link

Image Gallery Page in CMS won't load. #7

Open MattyBalaam opened 12 years ago

MattyBalaam commented 12 years ago

With a fresh install of Silvestripe 3.0.3, and the zip of display_anything installed, with the example ImageGalleryPage in mysite/code after creating the page, I just get the loading animation. It's been running for 10 minutes.

This is in Chrome 23, the site is running on MAMP 2.1.1, php5.4.4

MattyBalaam commented 12 years ago

VideoGalleryPage example also shows same behaviour.

zoao commented 12 years ago

You obtain a javascript error? I also installed in version 3.0.3 on windows and not had this problem

MattyBalaam commented 12 years ago

Hi, the console tells me: [23:00:29.285] Error: cannot call methods on button prior to initialization; attempted to call method 'destroy' @ http://localhost:8888/composer-test/framework/thirdparty/jquery/jquery.js?m=1352401611:551

MrJamesEllis commented 12 years ago

There were a bunch of commits on Nov 18 that may help here: https://github.com/codem/DisplayAnything3/commits/master

There were some issues with the uploader backend not kicking off post submit. The commits on Nov18 bind to the aftersubmit event.

If the the field has the text "Loading uploader..." then the uploader hasn't been able to attach itself to the file upload dropzone. The text showing is the default text that is replaced by JS.

Not sure about the destroy error, seems unrelated. I haven't been able to duplicate it.

Thanks James

MattyBalaam commented 12 years ago

If I comment out the requirements code on line 346 in DisplayAnythingGalleryField.php for jquery-ui the page loads and works.

I also notice there are a number of lines such as 349, 350, 359 and 360 which specifically state for the module directory to be called "display_anything". Perhaps you can detect the modules folder name, an implementation exists here: https://github.com/arambalakjian/DataObjects-as-Pages/blob/master/_config.php

MrJamesEllis commented 11 years ago

I see, we're loading the minified jquery JS but SS loads the non minified version, so it's possibly doubling up.

This was fixed internally but it looks like it hasn't made it up to Github. For now, this should work:

    Requirements::javascript(THIRDPARTY_DIR."/jquery/jquery.js");
    Requirements::javascript(THIRDPARTY_DIR."/jquery-ui/jquery-ui.js");

I'll leave the module directory as-is, it's mentioned in the readme and defining it at runtime seems to be the exception rather than the rule. https://github.com/codem/DisplayAnything3/#installing

I'll leave this open until the jquery change has gone up.