Project

General

Profile

Actions

Bug #77931

closed

foreign_record_defaults values not being stored in DB

Added by Tobi Kretschmann about 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-09-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Default values set in foreign_record_defaults are ignored when saving the element

I created a custom content element called "child-item".
A different content element has a relation that only allows this type of elements.
The Display of this config work perfectly fine.

However the database fields of that related content element are being filled with
CType => textmedia
colPos => 0

'ce_children' => [
            'exclude' => 0,
            'label'   => 'LLL:EXT:myext/Resources/Private/Language/locallang.xlf:ce_children',
            'config'  => [
                'type'                    => 'inline',
                'foreign_table'           => 'tt_content',
                'foreign_field'           => 'ce_parent',
                'foreign_record_defaults' => [
                    'colPos' => '999',
                    'CType'  => 'child-item'
                ],
                'maxitems'                => '50',
            ]
        ],
Actions #1

Updated by Tobi Kretschmann about 8 years ago

  • Priority changed from Should have to Could have

Ok, something that I left out:

'foreign_types' => [
    'child-item' => [
        'showitem' => 'header_link',
    ]
],

Now, the reason why the foreign_record_defaults are not saved in the DB is simply because these fields are not in the form that appear in the backend.
No form fields > no data can be transferred. :)

In addition to that, the colPos=999 is not set up. I believe that is why TYPO3 doesn't know if the content-element is even allowed in this col.

Although it would be nice that all set defaults would be saved, I am not certain anymore if it logical to implement since it does what I told it to do: Don't show the form fields.

Actions #2

Updated by Susanne Moog over 4 years ago

  • Status changed from New to Closed

Yes, as you noted, it does exactly what you told it to do. However, if you want to use something like this and still get the defaults you could try using a hidden palette for the fields you don't want to show but still make available to the form itself. Closing the issue now.

Actions

Also available in: Atom PDF