I'm getting the wrong js output on my page.
<script type="text/javascript" src="/gallery2/modules/search/SearchBlock.js"></script>
<script type="text/javascript" src="/<script type="text/javascript" src="/gallery2/themes/PGlightbox/theme.js">
</script>"></script>
<script type="text/javascript" src="/gallery2/themes/PGlightbox/images/lb/js/prototype.js"></script>
<script type="text/javascript" src="/gallery2/themes/PGlightbox/images/lb/js/scriptaculous.js"></script>
<script type="text/javascript" src="/gallery2/themes/PGlightbox/images/lb/js/lightbox.js"></script>
<script type="text/javascript" src="/gallery2/themes/PGlightbox/images/lb/js/slide.js"></script>
<script type="text/javascript" src="/sites/all/modules/jquery_update/collapse-fix.js"></script>
I tried to debug it, but i'm stumped now. As you can see the 2nd line, the script src is malformed. I'm trying to find where the theme.js is being called into drupal_add_js function. I looked at the gallery_set_javascript function in the gallery_base.inc file trying to printout the javascript files, but i got all the js except for the theme.js. If you could possibly help me out. thanks alot.
Comments
Comment #1
profix898 commentedIf theme.js is not passed through gallery_set_javascript() then its likely to be included in the G2 theme template directly. I suggest that you start searching there.
Comment #2
jmai commentedThanks.
Comment #3
thumb commentedI'm seeing a similar error with CSS with a few sites I'm attempting to upgrade:
jmai, if you've learned anything since posting, I'd sure appreciate it if you'd share, I'll do the same :) Seems that the problem may only occur in non-standard or custom G2 themes. My issue is happening in two different hacks of Siriux.
Comment #4
profix898 commentedFYI: There are two functions where the JS/CSS includes are processed:
What means, if gallery_set_* doesnt receive all elements, its likely that parseHead() failed to detect them. Can you please verify that parseHead() works correctly or post the head content of a page/theme that fails!?
Comment #5
thumb commentedIn Siriux, links to external style sheets are processed properly, including the following:
What isn't working are internal stylesheets, like the following:
I think the contents between the style tags are stuffed into the href value of link tag. Shouldn't be hard to reproduce.
Comment #6
jmai commentedI'm using the PGlightbox theme.
I mod the code in the function gallery_set_head in the gallery_base.inc to the following:
My output that I get is the following:
Comment #7
jmai commentedOK I think I found my problem. The parsing of the javascript files in the gallery_set_javascript of gallery_base.inc had failed because the ending
tag was on another line.
My original html javascript include was:
I did a printout of the parsing and got this:
As you can see, the index 1 doesn't get parsed correct.
The code line I need to fix is:
But I think I should look at the root of the problem in Gallery2 where the themes include all the necessary files. From reading how to create a theme, the fix was in theme.tpl. Thanks for your helpful hint profix898
Comment #8
thumb commentedThanks for sharing jmai. In my experience, calls to external JS files, like yours, keep the opening and closing script on one line. Seems like a simple fix for you, just remove the line break.
For internal stylesheets, it's a generally accepted practice by many to separate style declarations with line breaks as Siriux does. I may try to remove all line breaks to fix my problem, but I agree, it would be good to investigate further.
Comment #9
alexandreracine commentedIt's fine now? Good.
DEV version not supported anymore.
------------
Feel free to reopen but please look at the latest version first! It's probably fixed.
http://drupal.org/project/gallery
Closing (cleanup)