Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
\Drupal\rules\Engine\ExpressionManager::createAction() requires the $configuration to be passed as array, however else we usually expect the ContextConfig object - e.g. when using addAction(). This is inconsistent and should be fixed by expecting ContextConfig here also.
Comment | File | Size | Author |
---|---|---|---|
#5 | context-config.patch | 10.27 KB | TR |
| |||
#3 | context-config.patch | 9.7 KB | TR |
Comments
Comment #2
TR CreditAttribution: TR commentedSo, if I understand correctly, right now in our tests we do things like:
The
->toArray()
is needed because the signature forcreateAction()
isExpressionManager::createAction($id, array $configuration)
What you're proposing is to change the signature to
ExpressionManager::createAction($id, ContextConfig $config)
(with similar changes forcreateRule()
,createActionSet()
, andcreateCondition()
).This simply requires us to change the function signatures and move the
->toArray()
call into the aboveExpressionManager
methods rather than calling->toArray()
and passing the result to theExpressionManager
methods.Right?
That seems to be an almost trivial task if I correctly understand what you're proposing.
Comment #3
TR CreditAttribution: TR commentedComment #5
TR CreditAttribution: TR commentedComment #7
TR CreditAttribution: TR commentedCommitted. Feel free to re-open if I missed something.