Skip to content

Addition for https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us//ApiOverview/Fal/UsingFal/ExamplesFileFolder.html #5576

Open

Description

@github1maxserv

Current behavior

The section on creating file reference in backend context could use an addition.

Links

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Fal/UsingFal/ExamplesFileFolder.html#fal-using-fal-examples-file-folder-create-reference-backend

TYPO3 versions

Tested in v12

Possible Solution

In the example a file reference was created and added to an existing content element. If you also need to create the record (content element / page / something else) to which the file reference will be connected you can't yet specify the uid_foreign value. This field also doesn't support a "NEWxxxxx" placeholder (the TCA defines the uid_foreign field as number and DataHandler does not check this field for these placeholders).
The solution is to leave the uid_foreign field out of the data array completely (not empty, just remove it completely). When DataHandler processes the image/file field (with TCA type file) it will update the sys_file_reference record and set the uid_foreign field to the uid of the new record.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions