We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43371
    • 17 Posts
    I'm trying to troubleshoot why I cannot get 'Gallery' to work correctly in my Revo 2.2.8 site. I've traced it down to some issue on my provider, but I'm unsure what to try next.

    Symptoms: when I install the 'Gallery' package, the main Edit screen of the MODX manager is blank (the resource list on the left displays fine) for any Resources. Elements can be edited fine. When I examine the browser console, the fault appears to be because a <script> tag in the document <head> fails to load. The tag in question is:

    <script type="text/javascript" src="/~scdcorgh/manager/min/index.php?f=/~scdcorgh/assets/components/gallery/js/mgr/gallery.js,/~scdcorgh/assets/components/gallery/js/mgr/tree.js,/~scdcorgh/manager/assets/modext/util/datetime.js,/~scdcorgh/manager/assets/modext/widgets/element/modx.panel.tv.renders.js,/~scdcorgh/manager/assets/modext/widgets/resource/modx.grid.resource.security.local.js,/~scdcorgh/manager/assets/modext/widgets/resource/modx.panel.resource.tv.js,/~scdcorgh/manager/assets/modext/widgets/resource/modx.panel.resource.js,/~scdcorgh/manager/assets/modext/sections/resource/update.js,/~scdcorgh/assets/components/gallery/js/mgr/tv/Spotlight.js,/~scdcorgh/assets/components/gallery/js/mgr/widgets/album/album.items.view.js,/~scdcorgh/assets/components/gallery/js/mgr/widgets/album/album.tree.js"></script>


    Other calls to 'min/index.php' on the same page (with similar path references) work fine, it is just this one that fails.

    Curiously, it all works fine on all the machines I've tried this on at home, so I conclude that it is something to do with my hosting provider's environment. Beyond that, I'm not sure where to go next - I would really like to use the 'Gallery' package, and I'm quite happy to spend the time debugging this, I just don't know enough about the architecture of MODX to know where to start looking!

    Cheers,

    Andy
      • 37105
      • 194 Posts
      Did you try to set compress_js to no in your system settings?
        Codeplaza Webdesign: for professional websites at low cost
        • 43371
        • 17 Posts
        Many thanks. I tried that and it worked!

        But I also see a caution in the explanation for this setting suggesting that this probably isn't a good idea in general. I experimented with changing the maximum number of JS files that will be compressed, and by setting it all the way down to 1 I could get it to work too. Anything greater than 1 failed.

        Finally, by chance I tried this with IE10 (rather than Firefox and Chrome), and it worked without setting compress_js to 'no'.

        All very odd - anyone have any ideas?!

        Cheers,

        Andy
          • 43371
          • 17 Posts
          This is getting more confusing. I can make the offending call to 'min' work on Firefox by changing the order of the files. The order above has two 'gallery' js files, six js files from within the 'manager/assets/modext/' sub-tree, and a further five js files from the 'gallery' sub-tree.

          If I reorder the files so that all of the 'gallery' js files are before all of the 'modext' files in the call to 'min', this will work (at least under Firefox) - without setting 'compress_js' to No.

          Why would Minify be sensitive to the order of files, and why would this only be an issue with certain browsers?!

          Anyone have any ideas?
            • 43371
            • 17 Posts
            One further update - by setting the system setting 'compress_js_max_files' to 7 I can trick the system into working - there seems to be a 'plus one' issue where 'compress_js_max_files' of 7 will actually cause 8 files to be bundled in one call to Minify. The first 8 files are the 2 gallery ones plus the 6 modext ones. And this works. The remaining 5 gallery files are bundled into a second call to Minify, and that also works.

            It's not ideal, but it's better than nothing.

            Still very confused as to what is actually going on...