The way that the $head variable is being altered in adaptivetheme_mobile_preprocess_page() is heavy-handed.
Currently it's replacing the whole of $head, building it from scratch. The problem is that $head may already contain important meta, link, style or script elements arising from various modules.
The core book module, for example, includes standard HTML links in $head, like so...
<link href="/node/59" rel="prev"/>
<link href="/node/59" rel="up"/>
<link href="/node/61" rel="next"/>
Some browsers (or browser extensions) build user interface widgets from these, and it's quite conceivable that some mobile devices might be able to make use of them; they could work well with direction-pad button. The range of rel="" types is proliferating; HTML5 adds a whole new bunch, IIRC.
There are also quite a few contrib modules that add CSS style elements to the $head variable, e.g. Fivestar. They don't use drupal_add_css because they're building the CSS programatically.
What's really needed is to extend the $head variable during preprocessing, adding your new elements to the existing array.
Marking this issue critical since it breaks functionality of the core book.module and several from contrib.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | adaptivetheme_mobile-682424.patch | 1.07 KB | andrewmacpherson |
Comments
Comment #1
andrewmacpherson commentedHere's a fix. I'm treating the whole of the existing $head value as the first value in the array being built.
An alternative way is to simply say:
Comment #2
Jeff Burnz commentedYes, good point, it was kinda a quick hack, I removed all the code last night when I was testing out touch_icons so I found the problem then, thanks for the patch, will commit later today. Cheers!
I'll wrap an if (module_exists(touch_icons)) around the apple-touch-icon link tag as well ;)
Comment #3
andrewmacpherson commentedThanks Jeff.. and touch_icons isn't even out the door yet!
Comment #4
Jeff Burnz commentedCommitted to head, will update with beta2 shortly.