Bug #88738

`change` event not dispatched

Added by Andreas Fernandez 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
-
Start date:
2019-07-12
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Reproducible with the following issue:

  1. Have a record with a link browser (e.g. tt_content with field link_header)
  2. Select a page via link browser
  3. Save
  4. Now, open the link browser again and select another page
  5. In v9, the input field changed its view to show the URL. In v10, this doesn't work anymore

This is because `TBE_EDITOR.fieldChanged()` makes use of `jQuery.triggerHandler()`, which is incompatible with JavaScript's native `addEventListener`.


Related issues

Related to TYPO3 Core - Task #87324: Split FormEngine.js into smaller chunks Closed 2019-01-03

Associated revisions

Revision 65fa7b45 (diff)
Added by Andreas Fernandez 3 months ago

[BUGFIX] Dispatch native `change` event in TBE_EDITOR.fieldChanged()

With #87324 some code of FormEngine was moved into separated modules. In
the very same patch, most of the code was rewritten to use native
JavaScript as much as possible. However, with this change,
`TBE_EDITOR.fieldChanged()` was partially broken as it uses jQuery's
`triggerHandler` method to trigger a specific event. Events that are
registered via jQuery's `on()` method work fine, but the approach is
incompatible with JavaScript's native `addEventListener()` introduced
in the mentioned change.

As a quick fix, `TBE_EDITOR.fieldChanged()` now triggers the same event
for native JavaScript code via `dispatchEvent()`.

Resolves: #88738
Related: #87324
Releases: master
Change-Id: I38fbb97f86f6765a45ad763c27e7afdac5754b1c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61278
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Benni Mack <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Andreas Fernandez 3 months ago

  • Related to Task #87324: Split FormEngine.js into smaller chunks added

#2 Updated by Gerrit Code Review 3 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/c/Packages/TYPO3.CMS/+/61278

#3 Updated by Gerrit Code Review 3 months ago

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

#4 Updated by Andreas Fernandez 3 months ago

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

#5 Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF