how to reproduce:

you have a vocabulary A + term reference field "my_field_a_b" referencing vocabulary B
create a rule component which reacts on a term of vocabulary A.
the field "my_field_a_b" is not available using the data selectors.

using the condition Entity has field "my_field_a_b" beforehand doesn't help, nor does Data comparison for [my_term-term:vocabulary..., Data value: vocabulary A

the same scenario seems to work for nodes

Comments

floretan’s picture

Component: Rules Core » Rules Engine

I can confirm the same issue. However, I'm not sure whether this is an issue with Rules or with the Entity Metadata API.

fago’s picture

Status: Active » Fixed

indeed, it was a metadata issue. I improved it to incorporate the bundle for the referenced terms. To test update to the latest entity API - please reopen if there are any remaining problems.

dasjo’s picture

Status: Fixed » Needs review
StatusFileSize
new2.77 KB

the issue described above seems not to be fixed by fago's last commit.

attaching a patch which adds a rules test for the described use case.

Status: Needs review » Needs work

The last submitted patch, rules_term_reference.patch, failed testing.

dasjo’s picture

StatusFileSize
new2.71 KB

oops, git patch wrongly generated. hope this one works :)

fago’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, rules_term_reference_test.patch, failed testing.

fago’s picture

Status: Needs work » Needs review
StatusFileSize
new2.42 KB

thanks, the tests is incorrect though. (uses vocab, wrong condition entity_is_new).

I fixed the test -> attached. Patch still fails, thus verifies the problems.

Status: Needs review » Needs work

The last submitted patch, rules_terms_test.patch, failed testing.

fago’s picture

Status: Needs work » Needs review
StatusFileSize
new4.36 KB

ok, there were some more problems in the test I noted during fixing it -> also the field type was wrong + the actual assertion() did not work either. Anyway, attached patch should fix the problem + the tests.

The actual problem was that RulesState::addMetadataAssertions() has not follow a recent entity metadata API change yet, causing the problem for properties containing dashes/underscores.

fago’s picture

Status: Needs review » Fixed

all green now.. :) -> committed.

Status: Fixed » Closed (fixed)

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