Needs work
Project:
Rules
Version:
4.0.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
15 Oct 2017 at 11:27 UTC
Updated:
10 Sep 2024 at 01:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rlmumfordThis was a key feature in Drupal 7, I can't seem to find a mention of it in the roadmap?
Comment #3
rlmumfordComment #4
tr commentedYou have to start the test manually in this queue ...
Comment #5
rlmumfordUpdated for test fixes.
Comment #6
fagoThis looks like a good start, however I think we should add some test coverage for that!
Comment #7
rlmumfordNoticed another bug in Rules while working through this. It seems like different parts of the code assume different things about the 'context_definitions' and 'provided_context_definitions' properties in component config. In some places "provided_context_definitions" is assumed to be an array of names and "context_definitions" an array of all contexts associated with the component. Other places expect "context_definitions" to contain only those context_definitions required by the component and "provided_context_definitions" to contain the definitions of contexts that are provided by the component.
In the resulting confusion the code ended up such that RulesComponent::createFromConfiguration() and RulesComponent::getConfiguration() were not idempotent. (RulesComponentConfig::getProvidedContextDefinitions() and RulesComponent::createFromConfiguration() clearly expect 'provided_context_definitions' to be an array of definitions - RulesComponent::getConfiguration() would set 'provided_context_definitions' as an array of names)
In this patch, as well as exposing the feature requested in the UI, this bug has been fixed by making sure that "provided_context_definitions" is treated as an array of definitions where ever possible.
Comment #9
rlmumfordTest fixes.
Comment #11
rlmumfordSo switching to DI introduced more bugs.
Comment #12
fagothx, looks mostly good. However, I'm not sure the state changes should be done in execute() as usually we do the state setup in Drupal\rules\Engine\RulesComponent
I think this should be done in \Drupal\rules\Engine\RulesComponent::createFromConfiguration()
Comment #13
squibb commentedTag is wrong... in #11 patch
'#title_disply'has to be'#title_display'Comment #14
tr commentedIn regards to #7, those decisions and changes were made in:
See #2664700: Expose Rules components as action plugin
And https://git.drupalcode.org/project/rules/commit/3a0d230
Reading those might shed some light on the issue or indicate other places that need to be fixed.
Comment #15
shubham.prakash commentedMade the changes after rerolling.
Comment #16
tr commentedThe two test fails are because of bad strings in the test case. The tests are looking for:
"There is no Rules component yet." and "Add rule"
But they should be looking for:
"There are no rules components yet." and "Add component"
Can you fix those, re-roll the patch and see if the testbot likes it?
Comment #17
shubham.prakash commentedMade the changes as suggested.
Comment #18
tr commentedAnd that fail is because in the tests all the field names need to start with
context_definitions[instead ofcontext[because of the changes introduced by #3030295: 'context' deprecated in Rules @Condition annotation and #3092087: Deprecate 'context' in Rules @RulesAction annotationComment #19
shubham.prakash commentedComment #20
tr commentedNote that the tests stop executing once they hit a failure, so what you are seeing is that fixing one thing will cause more of the test to run, potentially exposing other fails.
But we're near the end of that test now, so this might be the last one. The error is "Button with id|name|title|alt|value "context_data" not found." I think you should just be able to remove that pressButton() call because it was meant to switch to the data selector in the UI but that is not necessary or possible anymore after #2804941: Implement assignment restriction in plugin context was fixed.
Comment #21
shubham.prakash commentedRemoved pressButton() for context_data
Comment #22
tr commentedNice! Thank you! Tests now pass, so we can move on to evaluating the functionality ... I will try to post a thorough review in the next few days. This is an important patch that would be very nice to get finished and committed to Rules.
Comment #23
rlmumfordJust flagging that the patch no longer applies on alpha6
Comment #24
megachrizThe patch indeed no longer applies, so it needs a reroll. Tagging with "Needs reroll". I removed the tag "Needs tests" as it seems to have tests already.
Comment #25
tr commentedThere are some major problems and omissions with the above patches.
I have put a lot of work into this and it's almost ready, but I haven't had time to work on it in the past few months. Assigning to myself. I'll try to finish this off soon.
Comment #26
dshields commentedIt'd be great to get this working
Comment #27
megha_kundar commentedComment #29
lukusJust adding that this would be a really useful piece of functionality.
Without this, the components have limited utility for my main use cases.
If there's anything I can do to help, please let me know.
Comment #30
rodmarasi commentedyes lukus. can you reroll a better patch?
Comment #31
rodmarasi commentedtest
Comment #32
marco5775 commentedhello,
the Rules plugin is really important to configure my Drupal sites without programming.
Where are we with this "feature request"?
Thank you for everything you do ;-)
Comment #33
kopeboySeconding this. I cannot do anything useful from the UI with Components right now if I cannot pass values from Rules nor calling the component from a View with VBO.
I can't code this but I would be very happy to sponsor your work to have this feature faster 🙏🏻
Comment #34
tr commentedThis fell off my radar last year. I still have the code, and if I recall correctly the only problem was that the ajax on the parameter add form wasn't working correctly. I'll see if I can reroll my patch and post it here as a first step.
Comment #35
tr commentedComment #36
kopeboyUp
Comment #37
alimbert commentedIs there an update on this?
Comment #38
tr commentedComment #39
rerozov commentedThis functionality is so important to Drupal. Basically Rules module and all his D7 functionality are the strong of Drupal.