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?

CommentFileSizeAuthor
#1 js_include_order.patch483 bytesborfast
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

borfast’s picture

Status: Active » Needs review
FileSize
483 bytes

It 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.

cnikiel’s picture

Hi, 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?

borfast’s picture

You 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.

cnikiel’s picture

Thank you for your answer.
Here is the error I get from Chrome:

Uncaught Error: Fatal error: No theme found.
g.raisejs_dQE4ShASUXUwQ6LmZ9DyMSj1rSAU5cJMYz94au7SL_g.js:604
g.init._target.g.theme.object.f.wait.errorjs_dQE4ShASUXUwQ6LmZ9DyMSj1rSAU5cJMYz94au7SL_g.js:565
f.wait.jjs_dQE4ShASUXUwQ6LmZ9DyMSj1rSAU5cJMYz94au7SL_g.js:533

Maybe it helps you.

borfast’s picture

Are 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.

cnikiel’s picture

WOW, 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:

Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function
Galleria.addTheme.init   galleria.classic.min.js:10
g.proxy   galleria-1.2.4.min.js:71
f.event.handle   jquery.min.js:17
f.event.add.k.i.handle.k   jquery.min.js:16
f.event.trigger   jquery.min.js:17
f.fn.extend.trigger   jquery.min.js:17
f.e.extend.each   jquery.min.js:16
f.e.fn.e.each   jquery.min.js:16
f.fn.extend.trigger   jquery.min.js:17
g.trigger   galleria-1.2.4.min.js:67
g._show.n   galleria-1.2.4.min.js:77
E.a.f.animate.complete   galleria-1.2.4.min.js:21
f.animate.s.duration.a.k.l.setTimeout.g.WEBKIT.g.TOUCH.q   galleria-1.2.4.min.js:13
f.each.f.fn.c.one.g   jquery.min.js:17
f.event.handle   jquery.min.js:17
f.event.add.k.i.handle.k   jquery.min.js:16
miro_dietiker’s picture

Title: "Fatal error: No theme found." when using the Views formatter and not logged in. » Anonymous JS Aggregation fail / views formatter: "Fatal error: No theme found."

Retitle

kroimon’s picture

I 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.

miro_dietiker’s picture

kroimon - this would be great! :-)

kroimon’s picture

The 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.

miro_dietiker’s picture

kroimon

Note that this solution doesn't allow you to load multiple galleria themes per page.
Is this even supported by galleria?

kroimon’s picture

Nope, 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.

damien_vancouver’s picture

@kroimon, pulling commit 10c47e5af3 solved my problem from http://drupal.org/node/1185248 .

I no longer get the Fatal Error: No theme found. :) Thanks!

kroimon’s picture

@damien_vancouver: Great to hear!

@miro_dietiker: Pull everything! :-)

(Or gimme commit rights ;-)

miro_dietiker’s picture

kroimon, 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.

kroimon’s picture

Status: Needs review » Fixed

Pushed. A new 7.x-dev build should be available shortly.

Marking this one as being fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.