Bug #87615

Variants don't use the finisherIdentifier for condition evaluation

Added by Ralf Zimmermann 8 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
-
Start date:
2019-02-01
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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".


Related issues

Related to TYPO3 Core - Bug #85301: EXT:form - show hidden fields in notification mail (finisher) Closed 2018-06-18

Associated revisions

Revision f4a7c61f (diff)
Added by Ralf Zimmermann 8 months ago

[BUGFIX] Use real finisher identifier in form element variants

Use the real finisher identifiers as they are configured in the
form definition instead the finisher implementation class name.
This requires a change of the public AbstractFinisher implementation
which implements the FinisherInterface. The interface is not changed,
as this would be a breaking change. Therefore, the existence of the
new method is checked. If it does not exist in a finisher
implementation, a fallback to the previous behavior happens.

Releases: master, 9.5
Resolves: #87615
Change-Id: I962502f0601845a5f9793751e87c97b3b902caa1
Reviewed-on: https://review.typo3.org/59606
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

Revision 8868fae1 (diff)
Added by Ralf Zimmermann 8 months ago

[BUGFIX] Use real finisher identifier in form element variants

Use the real finisher identifiers as they are configured in the
form definition instead the finisher implementation class name.
This requires a change of the public AbstractFinisher implementation
which implements the FinisherInterface. The interface is not changed,
as this would be a breaking change. Therefore, the existence of the
new method is checked. If it does not exist in a finisher
implementation, a fallback to the previous behavior happens.

Releases: master, 9.5
Resolves: #87615
Change-Id: I962502f0601845a5f9793751e87c97b3b902caa1
Reviewed-on: https://review.typo3.org/59610
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review 8 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59606

#2 Updated by Ralf Zimmermann 8 months ago

  • Related to Bug #85301: EXT:form - show hidden fields in notification mail (finisher) added

#3 Updated by Gerrit Code Review 8 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59610

#4 Updated by Ralf Zimmermann 8 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#5 Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF