Create better documentation for Drupal 9 / 10 Merge Vars

Created on 26 October 2023, about 1 year ago

Problem/Motivation

The webform_campaignmonitor and / or campaignmonitor modules fail if there is no name included in the information being transmitted. The campaignmonitor issue discussing this can be viewed here 🐛 Warning: Invalid argument supplied for foreach() in Drupal\campaignmonitor\CampaignMonitorSubscriptionManager->userSubscribe() (line 438 of modules/contrib/campaignmonitor/src/CampaignMonitorSubscriptionManager.php). Needs work .

Steps to reproduce

Install Drupal 10.
Install webform.
Install webform_campaignmonitor with dependencies.
Create a form with an email address and checkbox.
Add webform_campaignmonitor handler.
Submit form.

Proposed resolution

Update documentation to explain that 'name' is required to be included in the Merge Vars in the handler and include examples of how Merge Vars work.

For instance

name: '[webform_submission:values:name:raw]'

There's a fuller example of the similar issue with webform_mailchimp: https://www.drupal.org/project/webform_mailchimp/issues/2966193

The best solution would be for the module(s) not to break if a name is missing, but if it is required, it should be documented.

📌 Task
Status

Active

Version

1.0

Component

Documentation

Created by

🇬🇧United Kingdom sagraham

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

Comments & Activities

Production build 0.71.5 2024