Project

General

Profile

Actions

Bug #89732

closed

onChange does not react in FlexForm context

Added by Ralf Zimmermann over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
Start date:
2019-11-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

With https://github.com/TYPO3/TYPO3.CMS/commit/f274f58d0a10c5540a97fcd5a90f24559ee0b647#diff-d189334d4c1207ff3c0fd58820e4e596R125
the onChange behavior was moved into JavaScript land.
If you use an onChange instruction within flexform e.g https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Configuration/FlexForms/FormFramework.xml#L13 this does not work anymore.

@see https://github.com/TYPO3/TYPO3.CMS/commit/f274f58d0a10c5540a97fcd5a90f24559ee0b647#diff-d189334d4c1207ff3c0fd58820e4e596R128

`$parameterArray['itemFormElName']` contains something like `data[tt_content]1[pi_flexform]` which is used by javascript to fetch the element by the name attribute https://github.com/TYPO3/TYPO3.CMS/commit/f274f58d0a10c5540a97fcd5a90f24559ee0b647#diff-aae54a23dc527b7e222319447f2fba5cR836

But the form element data attribute within the FlexForm context is resolved like `data[tt_content]1[pi_flexform][data][sDEF][lDEF][settings.persistenceIdentifier][vDEF]` so `FormEngine.requestConfirmationOnFieldChange` can not fetch the element and therefore can not show the onChange modal.

And since checkboxes are rendered without name attributes `FormEngine.getFieldElement` does not work (https://github.com/TYPO3/TYPO3.CMS/commit/f274f58d0a10c5540a97fcd5a90f24559ee0b647#diff-aae54a23dc527b7e222319447f2fba5cR836)

We can replace

`GeneralUtility::quoteJSvalue($parameterArray['itemFormElName'])`

with

`GeneralUtility::quoteJSvalue('data' . $options['elementBaseName'])`

here https://github.com/TYPO3/TYPO3.CMS/commit/f274f58d0a10c5540a97fcd5a90f24559ee0b647#diff-d189334d4c1207ff3c0fd58820e4e596R128
but this does not solve the issue with html elements without name attributes


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #90672: TCA 'onChange' => 'reload' not working for checkbox fieldsClosed2020-03-07

Actions
Related to TYPO3 Core - Task #88665: Move "Refresh required" popup into FormEngine.jsClosedAndreas Kienast2019-07-01

Actions
Actions #1

Updated by Ralf Zimmermann over 4 years ago

  • Description updated (diff)
Actions #2

Updated by Ralf Zimmermann over 4 years ago

  • Description updated (diff)
Actions #3

Updated by Ralf Zimmermann over 4 years ago

  • Description updated (diff)
Actions #4

Updated by Ralf Zimmermann over 4 years ago

  • Description updated (diff)
Actions #5

Updated by Torben Hansen about 4 years ago

  • Related to Bug #90672: TCA 'onChange' => 'reload' not working for checkbox fields added
Actions #6

Updated by Georg Ringer about 4 years ago

  • Related to Task #88665: Move "Refresh required" popup into FormEngine.js added
Actions #7

Updated by Georg Ringer about 4 years ago

  • Target version set to 10 LTS
Actions #8

Updated by Georg Ringer about 4 years ago

  • Related to Bug #90672: TCA 'onChange' => 'reload' not working for checkbox fields added
Actions #9

Updated by Georg Ringer about 4 years ago

  • Related to deleted (Bug #90672: TCA 'onChange' => 'reload' not working for checkbox fields)
Actions #10

Updated by Georg Ringer about 4 years ago

  • Status changed from New to Closed

duplicate of #90672 and solved yesterday

Actions

Also available in: Atom PDF