Tokens that have not been replaced are not cleared

Created on 23 April 2024, 7 months ago

Problem/Motivation

When using tokens for fields that are optional, they are not cleared when kept empty.

Steps to reproduce

  • Configure a name field with first and last name, both optional
  • Specify tokens in the Brevo Webform handler: [webform_submission:values:name:last], [webform_submission:values:name:first]
  • Submit the form and leave those fields empty

Expected result: In Brevo, the FIRSTNAME and LASTNAME fields are empty
Acutal result: They contain the token values [webform_submission:values:name:last] and [webform_submission:values:name:first]

Proposed resolution

Use the clear option when replacing tokens. Also, remove the local $token_manager property since we're already inheriting $tokenManager from the base class.

🐛 Bug report
Status

Needs review

Version

1.2

Component

Code

Created by

🇩🇪Germany mrshowerman Munich

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024