Bug #67611
closed
Parent type in TCA work only after record saving
Added by Eric Chavaillaz almost 9 years ago.
Updated about 8 years ago.
Description
Hi,
I have a created a custom element who have a field defined as inline (IRRE).
This child element is used in several custom content elements. So to have different palette depending on the CType I have addes "'type' => 'tt_content:CType'" in my TCA.
It work fine when the IRRE exists really in the database (is not new) but if I create a new content element, the palettes with the index 0 is shown.
Thanks,
Eric
- Target version changed from 7.4 (Backend) to 7.5
- Target version changed from 7.5 to 7 LTS
The TCA of the child table points in its ctrl['type'] back to parent with 'tt_content:CType' ?
This can not work if "parent" is new and was not yet persisted and I see no chance to implement that in the near future.
The only way to achieve that is to have per CType that connects to the child one field which then holds the inline configuration to child and use the "foreign_types" inline option to override the child type array as needed. This will work, however, do not try to have different CTypes connected over the same field to child and have different "foreign_types" in a columnsOverrides, since this would lead to the same "it does not work if parent is new" issue. So, stick to one field per connection type.
- Status changed from New to Closed
To my eyes, this issue has not yet been resolved. So I wonder whether we could keep this issue open.
One solution would be, to add the type information of the parent record to the JSON stack.
Also available in: Atom
PDF