While the Rules 8.x conditions API is not fully finished yet, we can already port conditions to the existing core API. We are working at https://github.com/fago/rules - where you can some help on how to contribute!

Conditions overview

Data (data.rules.inc)

Entities (entity.rules.inc)

Node (node.rules.inc)

Path (path.rules.inc)

User (user.rules.inc)

PHP - Execute custom PHP code (php_eval) (is gone in Drupal 8: #1203886: Remove the PHP module from Drupal core)

To get started

  • pick your condition from above, create an issue for it and edit the list to reference the issue
  • look at the Drupal\node\Plugin\Condition\NodeType class (a core conditin) and Drupal\condition\Tests\Condition\NodeConditionTest.
  • Compared to the core NodeType condition, we do not use configuration or configuration forms yet, but specify all parameters as context for now. (The form stuff is still to be figured out)

Comments

omissis’s picture

Issue summary: View changes
omissis’s picture

Issue summary: View changes
paranojik’s picture

Issue summary: View changes
fago’s picture

Issue summary: View changes
bircher’s picture

Issue summary: View changes
jzavrl’s picture

Issue summary: View changes
Nebel54’s picture

Issue summary: View changes
bircher’s picture

Issue summary: View changes
fago’s picture

Issue summary: View changes
dasjo’s picture

Priority: Normal » Major
dasjo’s picture

Status: Active » Needs work
dasjo’s picture

dasjo’s picture

here's a list of current d7 rules conditions

Data
Data comparison (data_is)
Data value is empty (data_is_empty)
List contains item (list_contains)
List count comparison (list_count_is)
Text comparison (text_matches)

Entities
Entity is new (entity_is_new)
Entity has field (entity_has_field)
Entity is of type (entity_is_of_type)
Entity is of bundle (entity_is_of_bundle)
User has field access (entity_field_access)

Node
Content is of type (node_is_of_type)
Content is promoted to frontpage (node_is_promoted)
Content is published (node_is_published)
Content is sticky (node_is_sticky)

Path
Path has URL alias (path_has_alias)
URL alias exists (path_alias_exists)

User
User has role(s) (user_has_role)
User is blocked (user_is_blocked)

PHP (evil)
Execute custom PHP code (php_eval)

dasjo’s picture

Issue summary: View changes

updated to add a complete conditions overview

dasjo’s picture

Issue summary: View changes
fago’s picture

Issue summary: View changes
diarmy’s picture

Issue summary: View changes
Torenware’s picture

Issue summary: View changes

I made sure that ibonelli is marked as working on #2281089.

dasjo’s picture

Issue tags: +Contributor
dasjo’s picture

Issue tags: +SprintWeekend2015
dasjo’s picture

Status: Needs work » Active

as its a meta issue without a patch, setting to active instead of needs work

fago’s picture

I re-opened a few issues where there is some follow-up work todo.

sime’s picture

I'm noticing that in d8 all the rules conditions appear to be broken in the block configuration - was this due to a change in core since they were done? or was the block configuration integration a pending task?

fago’s picture