Closed (fixed)
Project:
Rules
Version:
8.x-3.x-dev
Component:
Module Integrations
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Sep 2015 at 14:38 UTC
Updated:
28 Dec 2015 at 12:04 UTC
Jump to comment: Most recent
Comments
Comment #2
ndeet commentedHi Josef, looks like low hanging fruit and the right task for me (and hopefully others) to get started. Don't have the big picture of rules and D8 in general yet so bear with me :D
Pull request: https://github.com/fago/rules/pull/232
Comment #3
Torenware commentedI'll grab the DataIsEmpty condition.
[#2572945: doExecute / doEvaluate for DataIsEmpty], PR https://github.com/fago/rules/pull/235
Comment #4
Torenware commentedGrabbing DataComparison ([#2573045: doEvaluate for rules_data_comparison]).
PR https://github.com/fago/rules/pull/236.
Comment #5
Torenware commentedWhile waiting for the Barcelona to finish its breakfast...
Grabbing class DataListContains (condition_id = rules_list_contains)
PR https://github.com/fago/rules/pull/238 for [#2574513: doEvaluate for rules_list_contains]
Comment #6
Torenware commentedGrabbing condition_id = rules_entity_field_access (class UserHasEntityFieldAccess).
Comment #7
botrisComment #8
botrisI've listed all the
execute()functions that are used in Actions.But the function is also used in 2 core functions and 3 tests, not sure if those functions should be updated as well:
RulesActionBase
ExpressionBase
TestLogAction
TestNodeAction
TestStringAction
Comment #9
botrisComment #10
botrisComment #11
Torenware commentedBoris,
Generally speaking, in the tests you want to call evaluate() or execute(), because you want the system to dispatch the action or condition. Also: remember that doExecute() and doEvaluate() are deliberately declared "protected". You can't call them in tests. So you have to use these in test classes.
In RulesActionBase, execute() is the magic glue that calls doExecute() on the action plug-in by finding the context and setting up the call to the plugin's doExecute() method. This is only called if the plugin does not override execute(). So to do your change, we need to remove the plugin's execute call, and replace it with doExecute() with the arguments in the same order as the annotation's context items.
RulesConditionBase does the same job with conditions and doEvaluate. So it must implement evaluate() as a public method.
This sometimes does not work right now due to #2573823: Context in Rules plugins does not respect annotation order. Some tests will fail until this issue is resolved.
I haven't looked at any expressions yet, but I think the principle's the same. So ExpressionBase needs to know how to set up a call to doExecute(), I think.After looking at this a bit, expressions work a bit differently. Typically, they get passed a RulesState object. So we probably should not include them under this issue. They're consumers of context.
Comment #12
Torenware commentedComment #13
ndeet commentedComment #14
Torenware commentedComment #15
ndeet commentedComment #16
ndeet commentedComment #18
ndeet commentedComment #20
ndeet commentedComment #21
ndeet commentedComment #23
ndeet commentedComment #25
ndeet commentedComment #26
ndeet commentedComment #27
ndeet commentedComment #28
ndeet commentedComment #29
ndeet commentedComment #30
Torenware commentedComment #31
emclaughlin commentedI grabbed VariableAdd, and here's the PR: https://github.com/fago/rules/pull/259
Associated issue: #2583861: doExecute for VariableAdd
Comment #32
emclaughlin commentedComment #33
emclaughlin commentedI grabbed DataListItemRemove and here's the PR: https://github.com/fago/rules/pull/260
Associated Issue: #2585019: doExecute for DataListItemRemove
Comment #34
emclaughlin commentedI grabbed UserIsBlocked and here's the PR: https://github.com/fago/rules/pull/262
Associated Issue: #2585321: doEvaluate for UserIsBlocked
Comment #35
emclaughlin commentedComment #36
emclaughlin commentedComment #37
emclaughlin commentedI grabbed PathHasAlias and here is the PR: https://github.com/fago/rules/pull/263
Associated Issue: #2585403: doEvaluate for PathHasAlias
Comment #38
emclaughlin commentedSnagged the PathAliasExists condition. PR here: https://github.com/fago/rules/pull/264
Associated Issue: #2585419: doEvaluate for PathAliasExists
Comment #39
emclaughlin commentedComment #40
emclaughlin commentedI grabbed NodeIsSticky and here's the PR: https://github.com/fago/rules/pull/265
Associated Issue: #2585429: doEvaluate for NodeIsSticky
Comment #41
emclaughlin commentedI grabbed NodeIsPublished and here's the PR: https://github.com/fago/rules/pull/266
Associated Issue: #2585431: doEvaluate for NodeIsPublished
Comment #42
emclaughlin commentedI grabbed NodeIsPromoted and here's the PR: https://github.com/fago/rules/pull/267
Associated Issue: #2585435: doEvaluate for NodeIsPromoted
Comment #43
emclaughlin commentedSnagged the NodeIsOfType condition. PR here: https://github.com/fago/rules/pull/268
Associated Issue: #2585463: doEvaluate for NodeIsOfType
Comment #44
emclaughlin commentedSnagged EntityIsOfType with a PR here: https://github.com/fago/rules/pull/269
Comment #45
emclaughlin commentedSnagged EntityIsOfBundle condition. PR here: https://github.com/fago/rules/pull/270
Comment #46
emclaughlin commentedSnagged EntityIsNew condition. PR here: https://github.com/fago/rules/pull/271
Comment #47
emclaughlin commentedSnagged EntityHasField condition. PR here: https://github.com/fago/rules/pull/272
Comment #48
emclaughlin commentedSnagged DataListCountIs condition. PR here: https://github.com/fago/rules/pull/272
Comment #61
reeller_sk commentedComment #63
reeller_sk commentedComment #64
dasjoComment #66
fagoComment #67
fagoComment #68
ndeet commentedComment #69
ndf commentedAdded last *not-refactored* conditions:
- DataIsEmpty
- UserHasRole
Comment #70
ndeet commentedComment #71
fagoDataListItemAdd - created pull request - 299 (reeller_sk): needs work
Comment #72
fagocan we mark items that needs work like this in the summary? It's hard to figure out what needs review and what not else.
Comment #73
fagoComment #76
klausiConditions are all done, yay!
Only one action remaining and updating the documentation.
Comment #77
shahinam commentedWhich item is remaining, Are you referring to PR #299.
Comment #78
shahinam commentedUpdate DataListItemAdd action to use doExecute().
PR: https://github.com/fago/rules/pull/326
Comment #80
klausimerged, thanks!
I think that was all for this issue, thanks everyone!