Bug #56221
closedCan't remove static templates from selection in template module
100%
Description
After including a static template to a template using the template module, it cannot be removed afterwards. Clicking the "remove" button produces this JS error (in FF 27.0.1):
ReferenceError: formEl is not defined var formObj = formEl.get(); FormEngine.js (line 178)
TYPO3-Version is current master (945911006229524d55cb48f1f7de0898be9a7b7f).
Updated by Philipp Gampe over 10 years ago
- Status changed from New to Needs Feedback
I cannot reproduce this. Are you sure that you cleared your browser cache?
Updated by Jost Baron over 10 years ago
Yes, and I've tried it again just now - same error. The code looks like this:
File: /typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js
174: // legacy function, can be removed once this function is not in use anymore 175: setFormValueManipulate = function(fName, type, maxLength) { 176: var $formEl = FormEngine.getFormElement(fName); 177: if ($formEl.length > 0) { 178: var formObj = formEl.get(); 179: var localArray_V = new Array();
I think the problem is a '$' missing in line 178.
Updated by Gerrit Code Review over 10 years ago
- Status changed from Needs Feedback 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/27820
Updated by Wouter Wolters over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6711c14b389df8d8c25fdf679804f0afaadb537b.
Updated by Mathias Wasserthal over 10 years ago
I still can't remove static templates.
The above fix fails a few lines later.
$formEl.get() returns an array of length 1, so in line 183
var fObjSel = formObj[fName + '_list'];
fails.
Changing line 178 to $formEl.get()[0] seems to work
Updated by Jost Baron over 10 years ago
Hi Mathias,
I can't reproduce the problem. It could be browser dependent, but according to the jQuery API ( http://api.jquery.com/get/#get2 ) you are right. Which browser do you use?
But it should be
var formObj = $formEl.get(0);in line 178.
Updated by Mathias Wasserthal over 10 years ago
Hi Jost,
Thanks for looking into it.
I've tried it with chrome 33 and FF 27.
A co-worker of mine had the same problem.
I also checked the jQuery Version used. It's 1.11.0.
We've t3jquery installed, but I don't think this should pose any problems.
Your solution is more educated for sure, I just needed a quick fix to keep on working without checking the jQuery API.
But using $formEl.get(0) is the better solution anyway, as it really gets what is needed: the first (and only) element.
Updated by Gerrit Code Review over 10 years ago
- Status changed from Resolved 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/28010
Updated by Gerrit Code Review over 10 years 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/28010
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28010
Updated by Nicole Cordes over 10 years ago
- Status changed from Under Review to Resolved
Applied in changeset 78213ca388d7b0f523a2e6050f972ae988fb4cac.