Bug #66832
closedFileupload in a record fails with TCA for "exactly one file" (minitems/maxitems=1)
0%
Description
Worked with 4.5.x, issue after upgrading to 6.2.x.
Problem occurs when working in the backing with a self-created record-type, which has a file-upload-field like for example an image.
When the field already contains an image it was previously possible to replace that with a new image ("Browse"-button right in the field when editing the record). Doing so on 6.2.x gives a yellow warning-sign and the record cannot be saved.
The error is JavaScript-related (validity-check before form-submit).
Problem seems to be the TCA-setting "exactly one file" (minitems/maxitems=1). Setting minitems to 0 it works fine. I expect the problem might be that upon choosing a new field to upload the current element gets dropped and so the minitems-check fails - because temporarily the field has 0 entries but at the same time a new fild to be uploaded (which makes it 1 again).
Obviously it's also not possible remove the file and saving the record before trying to upload a new one, since that would also violate the minitems-constraint.
TCA for field:
'image' => array (
'exclude' => 0,
'label' => 'The image',
'config' => array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/tx_myext',
'show_thumbs' => 1,
'size' => 1,
'minitems' => 1,
'maxitems' => 1,
)
),
Updated by Joerg Kummer over 8 years ago
I can confirm this behaviour. TYPO3 CMS 7.6.1
Updated by Riccardo De Contardi over 8 years ago
https://review.typo3.org/#/c/47337/ solves this too on TYPO3 7.6.x; the fix has not been backported on v. 6.2.x
Updated by Riccardo De Contardi about 6 years ago
- Status changed from New to Closed
I think it is safe to close this issue now... If I am wrong and this problem is still present on recent TYPO3 versions like 8.7.x or 9.4-dev please reopen it or ping me and I'll do.
Thank you!