Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting the above error, "Fatal error: No theme found.", when viewing a Views page that uses the Galleria formatter. The weird part is that it only happens when I'm not logged in; after logging in, Galleria starts wight away without any problems.
Anyone else has the same problem or knows how to fix it?
Comment | File | Size | Author |
---|---|---|---|
#1 | js_include_order.patch | 483 bytes | borfast |
Comments
Comment #1
borfast CreditAttribution: borfast commentedIt seems I just found out the problem. Apparently, for some reason, when I'm not logged in, the file "galleria-1.2.4.min.js" is being loaded after the file "galleria.load.js".
I changed the "galleria_add_js" function in galleria.module to give less weight to the file "galleria-1.2.4.min.js", thus making it load before the other Galleria files and so far it seems to be quite happy.
Patch attached.
Comment #2
cnikiel CreditAttribution: cnikiel commentedHi, I get an "no theme found" too, but your fix does not help me.
Also I am always logged in and the galleria-1.2.4.min.js is the first in the row of galleria scripts. Still not working for me. Any ideas what I can do to provide more info to pinpoint this issue?
Comment #3
borfast CreditAttribution: borfast commentedYou can see if your browser's Javascript console logs any error and if so, paste it here.
If you use Google Chrome or Firefox with Firebug, it should be quite easy.
Comment #4
cnikiel CreditAttribution: cnikiel commentedThank you for your answer.
Here is the error I get from Chrome:
Maybe it helps you.
Comment #5
borfast CreditAttribution: borfast commentedAre you using compressed JS files, in Drupal's performance configuration options? Or a minified version of the Galleria code? If so, try disabling that option or replacing the Galleria files with non-minified ones and check the Javascript console again.
Comment #6
cnikiel CreditAttribution: cnikiel commentedWOW, I turned off the aggregate javascript setting in the performace menu and nw it works perfectly.
Still get one error on the console though, but it works ;-)
Thanks so much.
In case you are interested in the error I still get:
Comment #7
miro_dietikerRetitle
Comment #8
kroimon CreditAttribution: kroimon commentedI could reproduce the out-of-order error when not being logged in. I can also confirm that the reorder patch fixes it partly, as long as JS compression is turned off.
This patch has been applied in my dev commit 97ae9ea786.
I'll try to figure out what's going wrong with compression later tonight or tomorrow.
Comment #9
miro_dietikerkroimon - this would be great! :-)
Comment #10
kroimon CreditAttribution: kroimon commentedThe problem is that Galleria is designed so that themes have to be in their own files. Merging the main library and the theme into one single file (as it's done by the JS compression) doesn't load the theme, so one has to use the Galleria.loadTheme() method manually.
Therefore, I switched from statically embedding the theme JS into the page to using JavaScript to load the theme file, which works for every scenario I could think of.
Commit 10c47e5af3 replaces the one from yesterday.
Comment #11
miro_dietikerkroimon
Note that this solution doesn't allow you to load multiple galleria themes per page.
Is this even supported by galleria?
Comment #12
kroimon CreditAttribution: kroimon commentedNope, multiple themes per page are not supported by Galleria. This has always been the case.
The code I wrote last month - almost a rewrite ;) - uses the theme of the first Galleria instance on the page, ignoring all others, so this change doesn't change anything but using the JS dynamic theme loading instead of embedding the theme with a script tag.
Comment #13
damien_vancouver CreditAttribution: damien_vancouver commented@kroimon, pulling commit 10c47e5af3 solved my problem from http://drupal.org/node/1185248 .
I no longer get the Fatal Error: No theme found. :) Thanks!
Comment #14
kroimon CreditAttribution: kroimon commented@damien_vancouver: Great to hear!
@miro_dietiker: Pull everything! :-)
(Or gimme commit rights ;-)
Comment #15
miro_dietikerkroimon, i finally missed to add you.
I have added you to the maintainer list now. :-)
For too fancy features, please first discuss with us.
And always make sure you try to provide an upgrade path. Generally no new feature in the public branch without an upgrade path once you have defined a feature set for a roadmap...
Could you please push the fixed tasks form the bugtracker? I'd be happy to see things fixed. In current state we can always reopen issues if they're still not fixed.
However as a next step i hope we can release a beta soon and get into stable... that's finally highest priority to me.
Comment #16
kroimon CreditAttribution: kroimon commentedPushed. A new 7.x-dev build should be available shortly.
Marking this one as being fixed.