Webform Calculation markup currently doesn't work with multiple expressions

Created on 30 July 2024, 4 months ago
Updated 17 September 2024, 2 months ago

Problem/Motivation

The validation fails when adding a Calculation Markup element to a Webform.

Steps to reproduce

Install "Webform UI" and the "Calculation Fields Example" submodule.

Edit the Webform Calculation fields multistep example "/admin/structure/webform/manage/webform_calculation_fields_multi" form, and add a new markup element with the following content:

Result: {{ :multiply_result / :to_divide }}

Calculation:
{{ :multiply_result }} / {{ :to_divide }} = {{ :multiply_result / :to_divide }}

On saving, the following error message is thrown:

The following field(s) (Result, Calculation) does not exists on the webform. Please check your expression!

Proposed resolution

The parser should only check the markup substituted elements for values.

Remaining tasks

It'd be nice if the markup calculation can handle multiple calculations within a single markup, but that doesn't seem to be supported at the moment. So depending on the scope of difficulty, this ticket can be extended to do that instead.

User interface changes

N/A

πŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

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