I just realized that none of Taxonomy properties work (tid and tid and childs).
Situation :
What i'm trying to do is to display a different theme when user visits nodes which have an special taxonomy term. The nodes have three vocabularies, two single select regular vocabulary and one tag type.
What i did :
I used the term id of the first vocabulary in the node with taxonomy:tid_and_childs property and selected a different theme.
Expected behavior :
I expected to see that theme instead of the default one when i visit the node but it shows me the default theme.
What i've already tried :
I tried various combinations but nothing helped. is this a bug or i'm missing something ? (Used to work on 1.x)
PS : Thanks for all your hardworks on 2.x version, it's much easier to use and much more flexible than before. Also thanks for the awesome documentation ;). Well done
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | theme_conflict_and_performance.patch | 1.6 KB | sinasalek |
Comments
Comment #1
mkalkbrennerCould you please turn on ThemeKey Debug and activate "Show ThemeKey properties values" and "Trace ThemeKey rule switching". Please post the output of the page where theme switching doesn't work like expected.
Comment #2
sinasalek commentedThe logs look strange, it shows no match for the one that works and says it uses the default theme but it users the matched theme. it shows match for the second one doesn't work.
This one uses path property and works : http://salek.ws/projects/drupal/works.txt
This one users tid_and_childs and does not work : http://salek.ws/projects/drupal/not_works.txt
Nice debugging feature BTW ;)
Comment #3
mkalkbrennerLooks strange. How are tids 307 and 104 related?
Comment #4
sinasalek commentedThey're from different vocabularies, 307 is a tag
Comment #5
sinasalek commentedNote that i used to work after this #584982: Does not respect hierarchy of terms
Comment #6
sinasalek commented@mkalkbrenner I traced the code and i'm sure that it detect the taxonomy correctly.
The problem is with assigning the theme. I'm also sure that it fill $custom_theme with the
correct theme. but i don't know why it doesn't work!!
Any kind of tips is highly appreciated :)
Comment #7
sinasalek commentedComment #8
mkalkbrennerif $custom_theme is set correctly there could be two reasons for your issue:
1. a different module that overrides $custom_theme after ThemeKey. Can you debug it's value in function init_theme() in theme.inc?
2. a different module that initializes the theme engine to early. Try this: http://drupal.org/node/681358#comment-2470222
Comment #9
sinasalek commentedThanks that helped,
There is a conflict with Revisions RSS module, least expected!, i'm trying to figure why it's happening.
Comment #10
mkalkbrennerPlease post some details when you figured them out. We already improved the compatibility to some modules in the past ...
Comment #11
sinasalek commentedI found it, the following code causes this issue.
Solutoins
- Commenting drupal_add_feed... !!
- Disabling revisions_rss modlue !!
- And changing the default weight of themekey module to -1 to decrease the possibility of conflicting with other module in future. As you know most modules' weight is 0 so it can happen again.
There is something i don't understand , why calling drupal_add_feed prevents themekey from setting the theme?
Comment #12
mkalkbrennerThere're two bugs in module revisions_rss:
It's not allowed to call node_load() within hook_init().
You must not call function t() within hook_init() (because this one starts the the theme engine).
See:
#582382: Blog Theme causes Fatal Errors in other modules, due to bad hook_init() implementation
#684868: Imagecache breaks, avoid node_load() in hook_init()
@sinasalek: Will you open a new issue at revisions_rss or should we move this one?
Comment #13
sinasalek commentedI understand now,
I think we should move this, it's good example of what issues it causes. I also changed the title.
Thanks for your help @mkalkbrenner.
Comment #14
sinasalek commentedRevisions RSS maintainers please read comment #12.
Thanks
Comment #15
sinasalek commentedI've decided to write the patch.
This patch replaces node_load with simpler alternative, It also fixes a performance issue. The previous code used to call node_load for almost every page now it only calls it if it when all other conditions met.
Comment #16
sinasalek commentedComment #17
alexjarvis commentedsinasalek/mkalkbrenner, thank you for bringing this to my attention. I am working on a fix now and hope to have an update for you to try tomorrow.
Comment #18
alexjarvis commentedRelease 1.5 should fix this issue. I migrated from hook_init to hook_nodeapi, which should improve compatibility and performance. Give it a try and let me know if you continue to have trouble.
Comment #19
sinasalek commentedAwesome , thanks