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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | token-465434.patch | 2.91 KB | klausi |
| #5 | rules_token_tax_fix.patch | 1.21 KB | fago |
| #5 | rules_token_tax_fix-rules.patch | 639 bytes | fago |
| #2 | token-rules-taxonomy-fix-2.patch | 1.38 KB | fearlsgroove |
| token-rules-taxonomy-fix.patch | 1.11 KB | fearlsgroove |
Comments
Comment #1
fagoAs 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.
Comment #2
fearlsgroove commentedUpdated to separate the mapping as a function, which also fixed style issues (i hope!)
Comment #3
fearlsgroove commentedComment #4
greggles@fago - we are near a token release. If you want this committed, let me know.
Comment #5
fagooh, 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.
Comment #6
fearlsgroove commentedTesting 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.
Comment #7
klausiEnhanced 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.Comment #8
fagoOh, 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!
Comment #9
fagooh, greggles granted me cvs access to commit stuff like this myself. So I've done so :)
Thanks all!
Comment #10
gregglesThank you, fago!