Token rules integration taxonomy fix
fearlsgroove - May 17, 2009 - 22:10
| Project: | Token |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | rules integration |
Description
Rules requires that taxonomy be split into 2 types - term and vocab, but token squashes those into a single entity. This is a simple hack to change the 2 rules taxonomy types to line up with the correct token type.
| Attachment | Size |
|---|---|
| token-rules-taxonomy-fix.patch | 1.11 KB |

#1
As the token taxonomy integration seems to access tid, I think only 'taxonomy_term' should be mapped. Then I think we should add an mapping function, where possible further mappings could be integrated easily. Apart from that the patch also conflicts with the coding standard - please make sure to obey them.
#2
Updated to separate the mapping as a function, which also fixed style issues (i hope!)
#3
#4
@fago - we are near a token release. If you want this committed, let me know.
#5
oh, sry for letting this lie so long.
@patch: Data types can be contributed, so this doesn't suffice as contributed types might need that mapping too. I've attached an updated patch, that allows the data type to specify the mapping. Please test if that works for you.
So we'd also need a patch for rules to add the property for the taxonomy type.
#6
Testing and working. Can't argue with making the token type more flexible. No ill effects on existing rules since it falls back to type, and I don't see any performance implications.
#7
Enhanced patch:
Added an if-clause to check if a type is not FALSE. This is useful for rules data types that want to disable token replacements (because they do not provide any).
'token type' => FALSEachieves exactly that.#8
Oh, thanks a great addition. I improved the patch for rules to make use of it (see #515608: Allow data types to specify a custom token type). Works fine for me, so let's get it in!
#9
oh, greggles granted me cvs access to commit stuff like this myself. So I've done so :)
Thanks all!
#10
Thank you, fago!
#11
Automatically closed -- issue fixed for 2 weeks with no activity.