Bug #91405

Form editor fails when editing FileUpload fields due to changes in how jQuery parses html with 3.5.0

Added by Markus Scholz over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
Start date:
2020-05-14
Due date:
% Done:

0%

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

Description

Hey guys,

after updating to 10.4.2 the FormEditor fails when editing a form that contains a FileUpload field. The reason seems to be a change in the latest jQuery release (3.5.0, https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/).

There are partials that have self closing div elements (e.g. typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Stage/FileUploadTemplate.html). Parsing this with jQuery has a different outcome now.

You can reproduce this in the browser console. Try running the following code in 10.4.1 and 10.4.2 backends:

$('<div class="element-content"><div data-template-property="properties.saveToFileMount" /><div data-identifier="multiValueContainer" data-template-property="properties.allowedMimeTypes"><div data-template-property="_value" /></div></div>').html()

Parsed result in 10.4.1 is:

<div data-template-property="properties.saveToFileMount"></div>
<div data-identifier="multiValueContainer" data-template-property="properties.allowedMimeTypes">
    <div data-template-property="_value"></div>
</div>

Parsed result in 10.4.2 is:

<div data-template-property="properties.saveToFileMount">
    <div data-identifier="multiValueContainer" data-template-property="properties.allowedMimeTypes">
        <div data-template-property="_value"></div>
    </div>
</div>

While processing templates and fields "properties.allowedMimeTypes" is overwritten, when updating "properties.saveToFileMount", resulting in "Invalid parameter 'key' (1475361755)".

I'd recommend updating the templates and avoiding self closing elements for non-void-elements (see https://html.spec.whatwg.org/multipage/syntax.html#start-tags).

Cheers,
Markus


Related issues

Is duplicate of TYPO3 Core - Bug #91367: TYPO3 9.5.17 error with ext:form and upload fieldsClosed2020-05-12

Actions
#1

Updated by Oliver Hader over 1 year ago

Please see issue #91367 which has a pending patch already...

#2

Updated by Oliver Hader over 1 year ago

  • Category set to Backend JavaScript
  • TYPO3 Version changed from 10 to 9
#3

Updated by Oliver Hader over 1 year ago

  • Related to Bug #91367: TYPO3 9.5.17 error with ext:form and upload fields added
#4

Updated by Oliver Hader over 1 year ago

  • Related to deleted (Bug #91367: TYPO3 9.5.17 error with ext:form and upload fields)
#5

Updated by Oliver Hader over 1 year ago

  • Is duplicate of Bug #91367: TYPO3 9.5.17 error with ext:form and upload fields added
#6

Updated by Oliver Hader over 1 year ago

  • Status changed from New to Closed
  • Target version set to 9.5.18 & 10.4.3

Also available in: Atom PDF