Needs review
Project:
Business Rules
Version:
2.0.0-beta1
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2021 at 11:42 UTC
Updated:
9 Feb 2023 at 21:38 UTC
Jump to comment: Most recent
There are lot of warnings related to the rules that contain tokens inside. The issue is on the token replace logic inside of the method processVariables() and processTokens() of the class src/Plugin/BusinessRulesItemPluginBase.php
Warning: preg_match_all() expects parameter 2 to be string, array given in Drupal\Core\Utility\Token->scan() (line 240 of /app/public/core/lib/Drupal/Core/Utility/Token.php)
#0 /app/public/core/includes/bootstrap.inc(312): _drupal_error_handler_real()
Provide a condition, for example sending an email with tokens inside, when a node is saved.
I've written a patch that fixes the warnings.
Need to check it well.
No changes.
No changes.
No changes.
| Comment | File | Size | Author |
|---|---|---|---|
| business_rules-8.x-2.0.0-beta1-warnings_fix.patch | 1.68 KB | andrei.vesterli |
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
andrei.vesterliComment #3
mlahde commentedWhen using Conditions to send emails after an entity save, I got multiple warnings and notices:
The actual email sending works correctly when the Condition is met the email get sent. The warnings don't emerge when I compare a typical Text (Plain) field's original and current value, but only when comparing a Text (Plain) or a Text (plain, long) fields that are grouped as a Field group in the "Manage form display" (/admin/structure/types/manage//form-display)
The provided patch seems to fix this.
Comment #4
andrei.vesterliHi there
Will any maintainer take a look at this small issue? I can prepare a fork for it too.