Bug #62001

[Regression] Can not add image to FAL field in Flexform

Added by Tymoteusz Motylewski about 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-10-02
Due date:
% Done:

100%

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

Description

commit cb6b7f519b54cec0d09f46966e5a8461f13e45e5
[TASK] Replace Prototype in inline record JS
Introduced a regression that FAL fields are not working in flexform any more.

How to reproduce:
1. download and install extension:
https://forge.typo3.org/attachments/download/26263/mediacenter.zip
2. put the "mediacenter" plugin on the page
3. try to attach some images to the FAL field.

Result:
Images will not show up under the "add file" button.


Related issues

Related to TYPO3 Core - Task #58475: Change IRRE Javascript code to jQuery Closed 2014-05-04

Associated revisions

Revision 0a578709 (diff)
Added by Tymoteusz Motylewski about 5 years ago

[BUGFIX] Make FAL work in the flexform field having dot in the name

Fixes regression introduced in I6599c3ce7eea493e2bfaa29312775bf1659ded69
During the change from prototype to jQuery few places missed
escaping of the dot in the id of the DOM node.

This patch fixes these places and also few other jQuery related bugs
E.g. we have to use "object.length" to test if jQuery selector
was found.

Resolves: #62001
Related: #58475
Releases: master
Change-Id: I9bb661c5bf58aa9b73106a1e48f2206465a8974e
Reviewed-on: http://review.typo3.org/33106
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision bf17a3f1 (diff)
Added by most wanted about 5 years ago

[BUGFIX] Escape element ID before used in jQuery selector

General information: to use any of the meta-characters as a
literal part of a jQuery selector, it must be escaped with
two backslashes: http://api.jquery.com/category/selectors/

Using IRRE (TCA type "inline") in Flexforms, TYPO3 may
generate HTML elements with IDs containing dots. Example:

id="data-104-tt_content-182-pi_flexform---data---fileSelection
---lDEF---settings.fileSelection.files---vDEF_records"

If you set "useSortable" and "endableControls.dragdrop" to 1
for an element in your Flexform configuration,
inline.createDragAndDropSorting(objectId) will get called for
that element. This objectId has to be escaped to be used as a
literal part of a jQuery selector later in this function.
Otherwise the drag-and-drop functionality will fail.

Resolves: #62676
Related: #62001
Releases: 6.2
Change-Id: I353a699d82885b7bd57d0dc5fafbb8f5646d693f
Reviewed-on: http://review.typo3.org/33777
Reviewed-by: Stefan Busemann <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Alexander Opitz <>
Tested-by: Alexander Opitz <>

Revision 609fa966 (diff)
Added by Alexander Opitz about 5 years ago

[BUGFIX] Follow up: Escape element ID before used in jQuery selector

Resolves: #62676
Related: #62001
Releases: 6.2
Change-Id: I50b1e24159ad79174a12f3b5130e1bfd8e77e8a5
Reviewed-on: http://review.typo3.org/34874
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Markus Klein <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>

History

#1 Updated by Tymoteusz Motylewski about 5 years ago

seems the problem is around line 486
the patch changed line:

new Insertion.Bottom(insertObject, htmlData);

to
TYPO3.jQuery('#' + insertObject).append(htmlData);

and "insertObject" is sth like "data-52-tt_content-272-pi_flexform---data---sDEF---lDEF---settings.mediacenter---vDEF_records"
and YES, there is a div with this exact id (including the dot in the id)
the dot is comming from the field name "settings.mediacenter"

the problem is that the dot "." is interpreted differently between prototype and jquery.
prototype just passes it to "getElementById" so it's ok to have a dot.
But jquery thinks this dot is a class selector.

The solution:
Escape dot before passing it to the jquery.

#2 Updated by Gerrit Code Review about 5 years 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 http://review.typo3.org/33106

#3 Updated by Gerrit Code Review about 5 years ago

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

#4 Updated by Gerrit Code Review about 5 years ago

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

#5 Updated by Tymoteusz Motylewski about 5 years ago

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

#6 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF