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.

Comments

fago’s picture

Status: Needs review » Needs work
Issue tags: +rules integration

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.

fearlsgroove’s picture

StatusFileSize
new1.38 KB

Updated to separate the mapping as a function, which also fixed style issues (i hope!)

fearlsgroove’s picture

Status: Needs work » Needs review
greggles’s picture

@fago - we are near a token release. If you want this committed, let me know.

fago’s picture

StatusFileSize
new639 bytes
new1.21 KB

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.

fearlsgroove’s picture

Status: Needs review » Reviewed & tested by the community

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.

klausi’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.91 KB

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' => FALSE achieves exactly that.

fago’s picture

Status: Needs review » Reviewed & tested by the community

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!

fago’s picture

Status: Reviewed & tested by the community » Fixed

oh, greggles granted me cvs access to commit stuff like this myself. So I've done so :)

Thanks all!

greggles’s picture

Thank you, fago!

Status: Fixed » Closed (fixed)
Issue tags: -rules integration

Automatically closed -- issue fixed for 2 weeks with no activity.