Project

General

Profile

Actions

Bug #103178

closed

Allowed file extensions not working after last patch

Added by Manuel Winkelhofer 9 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2024-02-22
Due date:
% Done:

100%

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

Description

Since the last Version 12 Patch the Settings for the allowed Files is not working properly anymore on "Create new Relation"
The end of the list of allowed files is cut off and ";DIS" is attached at the end of the list
So "*" becomes ";DIS"
And "GIF JPG JPEG TIF TIFF BMP PCX TGA PNG PDF AI SVG MP4 DOCX PPTX ZIP XLS XLSX" becomes "GIF JPG JPEG TIF TIFF BMP PCX TGA PNG PDF AI SVG MP4 DOCX PPTX ZIP XLS XLSX;DIS"

If i revert this commit here it works again:
https://github.com/typo3/typo3/commit/0cb86f3123#diff-cc09d3ba88ae5c071517f75cc7a758fa92068b59bf83bd72406212c25bbd2c20

I have the problems for Standard "File List" CEs and Custom Mask Elements.


Files


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #102992: Selecting files not always possibleClosed2024-01-30

Actions
Actions #1

Updated by Oliver Bartsch 9 months ago

  • Status changed from New to Needs Feedback

Hi,

thanks for creating this issue. Unfortunately, I was not able to reproduce this. Could you therefore please share corresponding TCA configuration and also the values of $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] and $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext']?

Best, Oli

Actions #2

Updated by Manuel Winkelhofer 9 months ago

Hi,
no problem happy to help.

imagefile_ext
gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg,mp4,docx,pptx,zip

mediafile_ext
gif,jpg,jpeg,bmp,png,pdf,svg,ai,mp3,mp4,flac,opus,webm,youtube,vimeo

Actions #3

Updated by Oliver Bartsch 9 months ago

  • Related to Bug #102992: Selecting files not always possible added
Actions #4

Updated by Gerrit Code Review 9 months ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83170

Actions #5

Updated by Oliver Bartsch 9 months ago

Hi,

thanks for the information. I however still can not reproduce this as the new delimiter is used by TYPO3. This therefore seems you either are using some old links to open the FileBrowser or an extension does create links with the old syntax. However I pushed a patch, respecting the old delimiter again for backwards compatibility. If possible, it would be great if you could test the patch.

Best, Oli

Actions #6

Updated by Manuel Winkelhofer 9 months ago

i copied the relevant code into the file and i can select the correct files again.
but i get the following error/notification in the file selector:

Core: Error handler (BE): PHP Warning: Undefined array key 0 in /var/www/html/vendor/typo3/cms-filelist/Classes/ElementBrowser/FileBrowser.php
on this line: [$allowed, $disallowed] = GeneralUtility::trimExplode(';disallowed=', $allowed, true, 2);

but that error is maybe because you are working in the main branch (13) it seems. my affected project is v12

some debug info from me, maybe it helps:

for filelist ce where it sould be a
$fileExtensions*
array(1 item)
0 => 'allowed=;disallowed=' (20 chars)
$allowed
';disallowed=' (12 chars)

for the mask element
$fileExtensions
array(1 item)
0 => 'allowed=gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg,mp4,docx,pptx,zip,x
ls,xlsx;disallowed=' (95 chars)
$allowed
'gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg,mp4,docx,pptx,zip,xls,xlsx;
disallowed=' (87 chars)

Actions #7

Updated by Oliver Bartsch 9 months ago

  • Status changed from Under Review to Needs Feedback

Hi, thanks for the feedback.

It would still be interesting to know where this link comes from, because TYPO3 does not create the bparams with the ; delimiter anymore.

Could you therefore please check, where this link is generated? In the best case you could provide the backtrace here.

Best, Oli

Actions #8

Updated by Gerrit Code Review 9 months ago

  • Status changed from Needs Feedback to Under Review

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83170

Actions #9

Updated by Gerrit Code Review 9 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83180

Actions #10

Updated by Gerrit Code Review 9 months ago

Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83180

Actions #11

Updated by Gerrit Code Review 9 months ago

Patch set 3 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83180

Actions #12

Updated by Manuel Winkelhofer 9 months ago

first of all the patch fixes the problem for me for now.
thanks for that.

im not quite sure how and what debug info i can send you so that it's useful for you

in the ElementBrowser.php in the render function
the value for $linkAttributes at the end is:

class => 't3js-element-browser' (20 chars)
data-mode => 'db' (2 chars)
data-params => 'data[tt_content][3575][file_collections]|||sys_file_collection|' (63 chars)
Actions #13

Updated by Oliver Bartsch 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Benni Mack 4 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF