Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have taxonomy spaces set up, and have tagged a node with a term from the spaces_taxonomy enabled vocabulary. However, when viewing this node, the relevant taxonomy space is not activated. Attached patch resolves for me. With this applied, the space is correctly activated when viewing the node.
Comment | File | Size | Author |
---|---|---|---|
#3 | spaces_taxonomy-1404586-return-taxonomy-space-3.patch | 1.65 KB | q0rban |
#3 | spaces_taxonomy-6.x-1404586-return-taxonomy-space-3.patch | 1.07 KB | q0rban |
#1 | 1404586.1-taxonomy_spaces-node-view-activate.patch | 868 bytes | mrfelton |
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedComment #2
chriz001 CreditAttribution: chriz001 commentedI had the same problem, however your code didn't work for me.. but i noticed your loading the space based on the object nid.
I changed that to load the space based on the tid associated with that node.
Seems to work for me.
Comment #3
q0rban CreditAttribution: q0rban commentedMarking as major, since this module doesn't even work without this functionality.
Attached patches for 7.x and 6.x. One thing to note on the 7.x patch. I see no reason to check for $type == 'node' anymore, as taxonomy can exist on other entities in 7. If someone disagrees, let me know and I can re-roll.
Comment #4
chriz001 CreditAttribution: chriz001 commentedLooks good to me.
Quick question, should we use $object->language instead of LANGUAGE_NONE when we load the space?
they both return 'und' if there is no language.
Im not sure, maybe it doesn't matter :)
Comment #5
Finn Lewis CreditAttribution: Finn Lewis commentedPatch http://drupal.org/files/spaces_taxonomy-1404586-return-taxonomy-space-3.... in #3 works for me.
But I agree with @chriz001 about the language issue - presumably using LANGUAGE_NONE would prevent this working muli-language content.
Comment #6
euk CreditAttribution: euk commented+1
Patch https://www.drupal.org/files/spaces_taxonomy-1404586-return-taxonomy-spa... in #3 works for me as well.
Using:
- Drupal v7.28
- Spaces 7.x-3.0-alpha1
However, if you look at the spaces_taxonomy class (spaces_taxonomy.inc), there is a method space_taxonomy::router, which has very similar piece of code:
I wonder if this method was supposed to switch spaces?
$op='init' is passed when viewing taxonomy. It switches spaces when navigating to something like 'taxonomy/term/56'
$op='node' seems to be never passed to the method.
Cheers!