Important: #106903 - Form element value resolution in finishers 

See forge#106903

Description 

Finisher options substitute {elementIdentifier} 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:

  • EmailFinisher : subject , title , message and senderName
  • ConfirmationFinisher : message
  • FlashMessageFinisher : messageBody and messageTitle

The same resolution already backed the summary page and the email body through the RenderFormValue 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 - senderAddress , recipients , replyToRecipients , carbonCopyRecipients and blindCarbonCopyRecipients - and the redirect targets pageUid , additionalParameters and fragment .

The SaveToDatabaseFinisher in particular never resolves labels. Both of its mapping routes store the submitted value: elements.<element> writes it directly, and databaseColumnMappings.<column>.value resolves a {elementIdentifier} placeholder to the same value, so a column filled through either route carries the same content. whereClause 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 AbstractFinisher->parseOptionAsDisplayValue() instead of parseOption() .

Two further behaviours changed along the way:

  • An array value interpolated into a longer string - a multi select inside Request for {salutation} {name} - previously aborted the finisher with a FinisherException carrying code 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 code 1787754756 .
  • The implementationClassName of the SingleSelect , MultiSelect , RadioButton and MultiCheckbox elements changed to GenericOptionableFormElement , and the one of CountrySelect to CountrySelect . Both extend GenericFormElement , so an instanceof check 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 FinisherException with code 1519239265 .

Migration 

No migration is required. Code catching 1519239265 no longer needs that branch.