Problem/Motivation

Currently there's a "entity has field" condition but none like "entity has property".
Such a condition could become very handy if you want to create very generic rules to handle entities of different types / bundles.

Proposed resolution

Re-use rules_condition_entity_has_field() and just provide an additional condition definition that doesn't limit the selection to fields. That's all everything else is already in place.
Btw. it would be nice to be able to assert multiple fields / property per condition as this would increase the speed of creating rules.

Remaining tasks

Reviews needed.

User interface changes

None.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

das-peter’s picture

Tried to add a test freehand. Let's see if this works. Test only patch is supposed to fail, the other not.

The last submitted patch, 1: rules-add-property-condition-2418365-1.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 1: rules-add-property-condition-2418365-1-test-only.patch, failed testing.

TR’s picture

Status: Needs work » Closed (won't fix)

While this feature may be useful, there has been NO ONE in the community who has been willing to devote even a minimal amount of effort to test or improve this patch over the past five years. So I don't think it's worth my while to spend any of my 100% volunteer time to get this patch to work and to add tests and to commit it to D7 Rules.

If you would like to see this feature implemented, please open a new issue WITH A PATCH and be prepared to follow-up on any questions/concerns raised when you post that patch.