Issue Bug Closed

#87615Variants don't use the finisherIdentifier for condition evaluation

Ralf Zimmermann 02/01/19, 13:36 updated 05/07/19, 12:13

Description

The docs (https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/core/Documentation/Changelog/9.4/Feature-84133-IntroduceVariants.rst#finisheridentifier-string) tell us, that we can use the identifier from a finisher within a form variant condition like:

type: Form
identifier: test
label: test
prototypeName: standard
finishers:
  -
    identifier: EmailToReceiver
    options:
      subject: xxx
      recipientAddress: foo@example.com
      recipientName: xxx
      senderAddress: foo@example.com
      senderName: ''
      replyToAddress: ''
      carbonCopyAddress: ''
      blindCarbonCopyAddress: ''
      format: html
      attachUploads: true
      translation:
        language: ''
renderables:
  -
    type: Page
    identifier: page-1
    label: Step
    renderables:
      -
        type: Text
        identifier: text-1
        label: 'Text 1'
        variants:
          -
            identifier: hide-1
            renderingOptions:
              enabled: false
            condition: 'stepType == "SummaryPage" || finisherIdentifier in ["EmailToSender", "EmailToReceiver"]'
  -
    type: SummaryPage
    identifier: summarypage-1
    label: 'Summary step'

The condition ‘finisherIdentifier in [“EmailToSender”, “EmailToReceiver”]’ does not work because of a wrong implementation (https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php#L1050). The finisherIdentifier is taken from the finisher implementaion class name without the “Finisher” appendix.
Since the EmailToSender and EmailToReceiver finishers are alias names for the EmailFinisher implementation, the result is the string “Email” within the condition variable “finisherIdentifier”.

Reviews 2