Important: #106903 - Form element value resolution in finishers
See forge#106903
Description
Finisher options substitute
{element placeholders with the
submitted value of that form element. Until now the raw submitted value was
used everywhere, so a select, radio button, multi checkbox or country select
element contributed its stored option key instead of the label an editor had
configured and translated - the subject of an email read
Request from mr
where the summary table below it read
Request from Mister
.
Options that are read by a human now resolve the placeholder through the form element itself and therefore use the translated option label:
Email:Finisher subject,title,messageandsenderName Confirmation:Finisher messageFlash:Message Finisher messageandBody messageTitle
The same resolution already backed the summary page and the email body through
the
Render ViewHelper, so both places now agree on what a
submitted value looks like.
Every other finisher option keeps the submitted value, because it ends up in a
stored record, a query or a URL, where the option key is what matters. That
includes the e-mail addresses next to the sender name -
sender,
recipients
,
reply,
carbon and
blind - and the
redirect targets
page,
additional and
fragment
.
The
Save in particular never resolves labels. Both of
its mapping routes store the submitted value:
elements.<element>
writes
it directly, and
database resolves a
{element placeholder to the same value, so a column filled
through either route carries the same content.
where matches
against it accordingly. A stored option key stays independent of the site
language the form was submitted in and of later label changes, and remains
usable for queries and joins - resolve labels when reading the records instead.
A custom finisher opts a single option into label resolution by reading it with
Abstract instead of
parse.
Two further behaviours changed along the way:
- An array value interpolated into a longer string - a multi select inside
Request for- previously aborted the finisher with a{salutation} {name} Finishercarrying codeException 1519239265. Such a value is now joined with,instead. An array that contains an object which cannot be converted to a string still throws, now with code1787754756. - The
implementationof theClass Name Single,Select Multi,Select RadioandButton Multielements changed toCheckbox Generic, and the one ofOptionable Form Element CountrytoSelect Country. Both extendSelect Generic, so anForm Element instanceofcheck against it keeps matching.
Affected installations
Installations using EXT:form whose email subject, confirmation message or flash
message references a select, radio button, multi checkbox or country select
element, and installations that catch
Finisher with code
1519239265
.
Migration
No migration is required. Code catching
1519239265
no longer needs that
branch.