Closed (fixed)
Project:
Themedev
Version:
master
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Apr 2006 at 15:38 UTC
Updated:
27 Apr 2006 at 15:30 UTC
Jump to comment: Most recent file
Drupal 4.7 drops the use of the 'base' tag, with the result that drupal_get_path no longer provides the proper value. Also, adding stylesheets has been changed and the use of drupal_set_html_head apparently is deprecated (although I'm having difficulty finding a definitive source on this).
The result is that the included stylesheets are not findable (unless your drupal system is actually at '/', which mine isn't). By using theme_add_style, everything seems to work again. I've attached a patch (at least, I think I have; it's definitely a diff) that will make everything work...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | themedev.module_0.diff | 2.98 KB | pukku |
| themedev.module.diff | 3.08 KB | pukku |
Comments
Comment #1
yched commentedSee here for a rather strong advise against theme_add_style...
Comment #2
pukku commentedOK. I've reattached the diff with the new suggestion.
However, where should I suggest that someone clarify this? I spent a while searching for things using drupal_set_html_head, drupal_add_style, etc., but never found anything to make it clear. I'm also still not clear why drupal_get_path doesn't include the base_path call (is there ever a time you wouldn't want the base path?), but that's a different issue.
Comment #3
adrinux commentedyched: themedev requires that it's stylesheets load last and override all other CSS to work properly - the exception in that advice applies to themedev. It seems perfectly acceptble to use theme_add_style in this context.
pukku: thanks for the diff. I'm looking into it.
Comment #4
adrinux commentedpukka: I liked the look of the theme_add_style approach in your first patch better, but theme_add_style doesn't seem to do what we need and add the themedev stylesheets after the theme stylesheet. Also you removed the stylesheet for the themedev block ;)
Though it seems the block is broken right now as well. Sigh.
For now I've essentially ignored your approaches and fixed the base_path issue (I hope), but stuck with my original approach. That still leaves a problem of theme stylesheets being imported after themedev ones. I have no idea how to fix that.
And now I must sleep. I'll look at this again tomorrow and if you can figure out why the block no longer appears...but then I need to update my HEAD checkout before I do anything else.
Comment #5
pukku commentedHi! I caught that I'd left out the block's css stylesheet in the second diff, which has it included. Sorry 'bout that...
Comment #6
adrinux commentedOK, I've settled on using theme_add_style and moving from drupal_set_html_head to hook_menu, since that's the way devel.module does it.
pukka: apparently it depends where/when you call drupal_get_path, base_path is added automatically doing it this way...
I'm marking this fixed, please open again if you have problems.
(the block is still awol, but that's a different issue)
Comment #7
adrinux commentedActually marking it fixed.
Comment #8
adrinux commentedTurns out the block is working fine - you have to remember that we now have *per theme* block settings!
Comment #9
(not verified) commented