[Regression] Can not add image to FAL field in Flexform
[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:
2. put the "mediacenter" plugin on the page
3. try to attach some images to the FAL field.
Images will not show up under the "add file" button.
Updated by Tymoteusz Motylewski over 6 years ago
seems the problem is around line 486
the patch changed line:
new Insertion.Bottom(insertObject, htmlData);
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.
Escape dot before passing it to the jquery.