With Taxonomy Theme enabled, and specifically, in the TT admin page, the "Template selection" under the Taxonomy tab set to anything other than "Disabled", then subdomains of the main site have content node pages that revert to the main site theme, rather than keeping the subdomain theme set in the Domain Theme module.

All the other pages are using the Domain Theme theme, just when i click all the way down to seeing the content node itself, that takes on the main site system default theme.

When i set the Taxonomy Theme admin "Template selection" to "Disabled" then content node pages take on the subdomain theme.

b

CommentFileSizeAuthor
#4 dt.patch1.72 KBagentrickard

Comments

ben soo’s picture

--o yes. i neglected to note that varying the module weight of Taxonomy Theme and/or Domain Theme has no effect on this problem.

Soon's i disable "Template selection" in the TT admin then it works as expected.

i've no idea into which module a code fix should go, or if it's fixable, so am kinda just making a note of what glitches i'm running into.

b

agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)

Can you tell me where (in what function) TT sets its custom theme?

If it isn't in hook_menu(), there is likely nothing to be done.

ben soo’s picture

TT has implementations of

hook_perm() --> taxonony_theme_perm()
hook_menu() --> taxonomy_theme_menu()
hook_form_alter() --> taxonomy_theme_form_alter()

taxonomy_theme_menu() is used to either
generate the TT admin forms
or
"perform theme selection and assign theme (using init_theme)" by calling
_taxonomy_theme_assign()

_taxonomy_theme_assign() calls these functions to do the theme assignation:

_taxonomy_theme_select_term()
_taxonomy_theme_vocabulary()
_taxonomy_theme_alltaxonomy()
_taxonomy_theme_nodetype()

They're in the file "taxonomy_theme_taxonomy.inc" and seem to do their assignments by putting values into

$custom_theme

and returning, then _taxonomy_theme_assign() calls init_theme() at the bottom of the function.

i'm a C programmer and not PHP, but that's what it looks like to me. Is that what you're looking for?

b

agentrickard’s picture

Assigned: Unassigned » agentrickard
Category: support » bug
Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new1.72 KB

Yes. The issue is that Domain Theme performs its action in hook_init(), which fires before hook_menu(). That's why module weighting doesn't change the problem.

The fix is to move the theme assignment into hook_menu(). Try applying the attached patch.

agentrickard’s picture

Status: Active » Needs review
ben soo’s picture

Works!!

Amazing absolutely.

i was setting up to hack TT and put in some form of your $_domain global, and now i don't have to!

i have to set the Domain Theme module weight to some value ( TT module weight + X ) and it works.

--i always still get confused how to express module weight. When people here say "heavier" do they mean ( Initial Value - X ) or ( Initial Value + X ), and is the resultant weight "lower" or "higher" than the initial weight?

Off to do emergency outdoors electrical repairs for the folks. My middle name will be "crispin" by Mon.

thanks much, agentrickard.
b

--and also, now that i've looked thru the TT code i know it's simple enough for me to hack, so if this patch is going to mess things up elsewhere i can always just modify TT instead.

agentrickard’s picture

Status: Needs review » Needs work

Hacking modules is generally a bad idea.

But I'm testing the patch and not seeing the behavior that I expect. With the current patch, TT _always_ overrides DT, which is not desirable.

I think the issue is that TT uses init_theme(). I'm still investigating.

agentrickard’s picture

Personally, I think there is a bug in Taxonomy Theme. I don't believe that modules should invoke init_theme().

I'm going to commit the patch as is, but I believe that the behavior result will be that Taxonomy Theme will always override Domain Theme.

agentrickard’s picture

Status: Needs work » Closed (fixed)

Committed to HEAD. This was a good bug catch, as the theme switch needs to happen in hook_menu().

ben soo’s picture

Thanks again, agentrickard. i've been very happy to know that developers such as yourself and SomebodySysop are responsible for the modules i rely on a lot.