Fix the warnings with the preg_match_all() and processVariables()

Created on 9 December 2021, over 2 years ago
Updated 9 February 2023, over 1 year ago

Problem/Motivation

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()

Steps to reproduce

Provide a condition, for example sending an email with tokens inside, when a node is saved.

Proposed resolution

I've written a patch that fixes the warnings.

Remaining tasks

Need to check it well.

User interface changes

No changes.

API changes

No changes.

Data model changes

No changes.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡²πŸ‡©Moldova andrei.vesterli Chisinau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024