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

CommentFileSizeAuthor
#2 themedev.module_0.diff2.98 KBpukku
themedev.module.diff3.08 KBpukku

Comments

yched’s picture

See here for a rather strong advise against theme_add_style...

pukku’s picture

StatusFileSize
new2.98 KB

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

adrinux’s picture

yched: 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.

adrinux’s picture

pukka: 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.

pukku’s picture

Hi! I caught that I'd left out the block's css stylesheet in the second diff, which has it included. Sorry 'bout that...

adrinux’s picture

OK, 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)

adrinux’s picture

Status: Needs review » Fixed

Actually marking it fixed.

adrinux’s picture

Turns out the block is working fine - you have to remember that we now have *per theme* block settings!

Anonymous’s picture

Status: Fixed » Closed (fixed)