Issue Bug Closed

#64621FAL relation could be created even if the filetype is not allowed for the TCA field

Sascha Egerer 01/29/15, 22:52 updated 10/02/18, 11:46

Description

It is possible to create a FAL file relation even if the file extension is not allowed for this field.

Reproduce:
  1. Create a new image element
  2. Modify the “Add Image” button (using firebug e.g.) from something like
    @setFormValueOpenBrowser(‘file’, ‘|||gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai|data-38-tt_content-173-image-sys_file_reference|inline.checkUniqueElement||inline.importElement’); return false;@
    to
    @setFormValueOpenBrowser(‘file’, ‘||||data-38-tt_content-173-image-sys_file_reference|inline.checkUniqueElement||inline.importElement’); return false;@
  3. Click on open Image. You’ll now be able to select any kind of file.
  4. select a non image file
  5. The file is visually added to the content element
  6. Save the record

Result:
You won’t see that the records has been added what is the expected behavior.
But it is added. The relation is created in the database but not displayed in TCA as the file extension is not allowed.

Expected Result:
The relation should never be created by checking the file extension before creating the relation.

Reviews 1