Hi Aporie,

Hope you're fine.
I have been switching to Drupal 9 and I have tested Commerce Funds extensively.
I have noticed that Rules action fails when it comes to perform a transaction.

By similarity with issues I have faced with other modules, I have figured out that the problem is due to the "context" annotation in \src\Plugin\RulesAction\TransactionPerform.php.

The following has to be updated in this file:

Line 16:
- * context = {
+ * context_definitions = {

Line 32:
- $this->getPluginDefinition()['context']['transaction']->setDataType($type);
+ $this->getPluginDefinition()['context_definitions']['transaction']->setDataType($type);

After these corrections, the Rules transactions work again.

Apologies, but I have really no time to propose a proper patch in the next days (my day job is taking all my free time...) , but I hope the above helps to support other users who may have the same issue.

Cheers,

Comments

Arno2Mars created an issue. See original summary.

aporie’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB

Hey Arno2Mars,

Well done ! Was able to reproduce the bug and your fix fixes it.

I've made a patch for it as I can't set the minimum rules version requirement until the change on how they define the context is still is their dev branch (Rules team).

Thanks for the help.

  • Aporie committed 7bc6afd on 2.x
    Issue #3166142 by Aporie, Arno2Mars: Rules action "perform transaction"...
aporie’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.