Bug #66832

Fileupload in a record fails with TCA for "exactly one file" (minitems/maxitems=1)

Added by Stefan Neufeind over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2015-05-07
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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,
)
),


Related issues

Related to TYPO3 Core - Bug #67237: BE upload not possible when minitems=1 Closed 2015-06-02
Related to TYPO3 Core - Bug #68795: The fields marked with a yellow exclamation mark are not yet correctly filled in. Please complete them properly. Closed 2015-08-06
Related to TYPO3 Core - Bug #71619: FAL relation with min=1, max=1 not deletable Closed 2015-11-17

History

#1 Updated by Joerg Kummer almost 4 years ago

I can confirm this behaviour. TYPO3 CMS 7.6.1

#2 Updated by Riccardo De Contardi over 3 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

#3 Updated by Riccardo De Contardi over 1 year 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!

Also available in: Atom PDF