Before I start testing the php4, I was going to see if I could get everything working with the php5 setup when I found this problem.
<style type="text/css" media="all">@import "/ictures/modules/core/data/gallery.css";</style>
<style type="text/css" media="all">@import "/ictures/modules/icons/iconpacks/silk/icons.css";</style>
<style type="text/css" media="all">@import "/ictures/themes/matrix/theme.css";</style>
<style type="text/css" media="all">@import "/link rel="stylesheet" href="/lib/slimbox/css/slimbox.css" type="text/css" media="screen" />";</style>
<style type="text/css" media="all">@import "/ictures/main.php?g2_view=imageframe.CSS&g2_frames=none";</style>
<style type="text/css" media="all">@import "/files/css/bbef32b5adbd7043bb3723aab1c32095.css";</style>
Most of those lines are simply missing a "p" between the "/" and the "i", but the one with @import "/link rel="stylesheet" href="/lib/slimbox/css/slimbox.css" type="text/css" media="screen" />"; looks pretty messed up. I'm using the matrix theme that has an extra link tag in the header(theme.tpl), placed immediately below the default one.
Thanks for your help. Let me know if it's my customized theme or something else...
Comments
Comment #1
profix898 commentedThanks for your help. I recently modified the css parser, so it is likely there is a bug in the code.
What are your coding skills? Do you know how to apply a patch? Dont get me wrong, I'm just asking to find the most effective way for us to communicate. Should I simply add the patch to cvs directly or would you prefer the patch posted here for review?
Comment #2
profix898 commentedCan you please post the css lines of your standalone gallery for comparison?
Comment #3
sewpafly commentedI'm fairly technical (I am a software engineer) and I don't fear patches. I would suggest doing whatever is easiest, since that is my usual method...
Standalone HTML header - http://drupalgallery.1t2.us/1247
Embedded HTML header - http://drupalgallery.1t2.us/1249
For what it's worth, the embedded main (e.g. ?q=gallery) doesn't have these problems, it's only the sub albums.
Comment #4
profix898 commentedI dont know why, but G2 return different paths for css for the root album and subalbums (incl. admin pages). Here is a patch to unify the paths before inclusion in Drupal.
Comment #5
profix898 commentedSame is true for javascript also ...
Comment #6
profix898 commented... taking a look at http://drupal.org/node/145284 ... inline styles are not recognized and therefore inserted corrupted ... Attached patch solves both issues (1. wrong include paths, 2. unrecognized inline css). Hope it covers all cases now. Works with Matrix and Siriux for me.
Comment #7
sewpafly commentedI applied the first patch before I got the message about the second one and so I started investigating how to checkout the latest from CVS and I tried using the -r "DRUPAL-5--2" switch but obviously that doesn't get the latest changes... Do you know what tag should be used for the latest stuff?
Comment #8
profix898 commentedAn anonymous checkout should work with ...
At least it works for me. If you have a cvs account on drupal.org you can (of course) use your own username:password instead of anonymous:anonymous.
Comment #9
sewpafly commentedThe patch solved everything except for the one really weird line:
I then changed it in the theme from:
to
And everything appears normally.
Comment #10
profix898 commentedOh, yes. The regexp is incorrect. This one should work. Thanks for testing :)
Comment #11
profix898 commentedIt's getting late where I am (Germany). I will commit the patch tomorrow if no more problems appear the next hours ...
FYI: You should take advantage of the 'status' field when updating issues, e.g. 'patch (code needs work)', etc.
Comment #12
sewpafly commentedI don't know what happened, but when I tried the latest patch everything broke and I haven't been able to fix it either by rolling back the patches and/or reapplying any of the patches. I'm pretty confused. I'll look at it some more tomorrow.
Comment #13
Dahaniel commentedI never applied a patch before. I found the book page here on drupal.org and understand that I would need to download a tool for this. No problem so far, nut do I have to applie your patches one after another or is it enough to applie the newest?
Comment #14
Dahaniel commentedI never applied a patch before. I found the book page here on drupal.org and understand that I would need to download a tool for this. No problem so far, nut do I have to applie your patches one after another or is it enough to applie the newest?
Comment #15
profix898 commented@sewpafly: "I haven't been able to fix it either by rolling back"
It was just a small change compared to patch in #2, I dont see why this should break everything ...
@Dahaniel: "do I have to applie your patches one after another or is it enough to applie the newest?"
All patches are against the latest cvs version (DRUPAL-5--2 branch), they are just revisions. Its enough to apply the most recent one.
(Tell us if you have trouble applying patches, its really easy once you know how.)
Comment #16
sewpafly commentedOkay, I really don't know what's going on. On one computer (work) it looks fine, but on another (home) it's encountering the same old issues... Any ideas? I tried logging in and out and flushing gallery's cache. Drupal's caching feature is disabled. Could it be something else?
Comment #17
profix898 commented@sewpafly: Do you have trouble only with the latest patch or with the others as well in your 'home' environment? I cant think of a good reason for this different behaviour. I hope you will tell me shortly that it is not related to the patch but to your infrastructure ... ;)
Comment #18
sewpafly commentedOkay, so I took a couple minutes out from work to look at this. Here's what I found: the drupal hooks want everything from the base_path(), but the GalleryEmbed class will give you the full path to the file if you use something other than www.site.name. At least on my system when you access from http://site.name/?q=gallery, it hates that and tries to send you the full paths of the css and js files. So I hammered out a fix that solves the problem for css by using the drupal_add_link function (Which doesn't add an <a href>, but a normal link tag). However, I couldn't get the javascript working perfectly,
My code looks like this:
in place of
But that puts the javascript files out of order, and I don't know if that causes other problems. Mine appears to work perfectly this way however. Here's a patch file that contains my changes
Comment #19
profix898 commentedYour patch uses drupal_set_html_head() (or drupal_add_link() which uses drupal_set_html_head() internally). There are three issues with this approach:
I think we need some simple logic to handle different css/js paths returned by Gallery2. Actually I dont understand why G2 return different paths for different urls (with/without www. and even for album/subalbum) at all. This should probably be discussed with the G2 devs.
Comment #20
profix898 commentedThere are four different cases to handle (applies to css and javascript paths):
They all must be transformed into case #2 (relative to base_path() which is /drupal5/ in this example). Am I missing something here? Any missing cases? Its really strange why G2 doesnt return uniform references ...
Comment #21
sewpafly commentedThat sounds about right. On my site there I see three, but I might see a different one if my base_path() wasn't '/'.
Comment #22
profix898 commentedOk, here is a another patch to get this right! It adds the ability to include external file paths (with redundancy check) in case G2 is installed on a different host, but uses drupal_add_css/js() if possible.
Comment #23
profix898 commentedSimilar patch to #22 with some smaller changes (use of md5, always check redundancy).
Comment #24
sewpafly commentedLooks good from here.
Comment #25
profix898 commentedCommitted to Drupal-5--2 branch. Thanks a lot for review sewpafly.
Comment #26
(not verified) commented