Bug #84232
closedHow to use ###PAGE_TSCONFIG_UID### with the fieldControls's "addRecord" in TCA?
0%
Description
Neither the core nor the documentation (and so far my google search would lead me to even say: not even Google) offer a good example on how to use markers with "addRecord" in the TCA.
The situation is the following:
Each of the 2 tables - be it "category" and "book" - have a field, that relate to each other via m:m. The objects themselves have their own storagePid (and therefore folder page), where they store their data. "Category" as well as "Book" display their m:m-relation as a "selectMultipleSideBySide" select field, by which the records form "the other side" can be managed.
It makes sense to add an "addRecord" button to the fieldControl parameter, so I can add a "category" record, when I am in the "Book" form and vice versa. In order to save the record "from the other side" to its proper storagePid (folder page), the TCA requires the use of a marker like ###PAGE_TSCONFIG_UID###. The documentation does not clearly explain, how this is done, and so far it does not seem to work.
Documentation on "addRecord" within a "multipleSideBySide" renderType:
https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Select.html#addrecord
As soon as "addRecord.pid" gets assign a hardcoded value, everything works as expected - with the very disturbing side effect that, upon saving, any and every data that was already selected, will be removed. This will be an extra entry, as soon as I get the markers working.