Project

General

Profile

Actions

Bug #71293

closed

Story #69712: Further FormEngine development

`foreign_record_defaults` is not stored when the field hidden

Added by Artus Kolanowski over 8 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
Start date:
2015-11-03
Due date:
% Done:

0%

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

Description

You have the two tables tx_enterprise_domain_model_address with three different types of addresses (phone, email and postal). Per default the type select is visible in all types.

array(
    'ctrl' => array(
        [...]
        'type' => 'type',
        [...]
    ),
    'types' => array(
        '0' => array(
            'showitem' => '
                    --palette--;;general,
                    --palette--;;postal,
                    --palette--;;phone,
                    [...]
            '
        ),
        'postal' => array(
            'showitem' => '
                    --palette--;;general,
                    --palette--;;postal
            '
        ),
        'phone' => array(
            'showitem' => '
                    --palette--;;general,
                    --palette--;;phone
            '
        ),
        'email' => array(
            'showitem' => '
                    --palette--;;general,
                    --palette--;;email
            '
        ),
        [...]
    ),
    'palettes' => array(
        'general' => array(
            'showitem' => '
                type
            '
        ),
        'postal' => array(
            'showitem' => '
                street,
                [...]
            '
        ),
        'phone' => array(
            'showitem' => '
                phone,
                [...]
            '
        ),
        'email' => array(
            'showitem' => '
                email,
                [...]
            '
        ),
        [...]
    ),
    'columns' => array(
        [...]
        'type' => array(
            [...]
            'config' => array(
                'type' => 'select',
                'default' => 'postal',
                'items' => array(
                    array(
                        'Postal',
                        'postal'
                    ),
                    array(
                        'Phone',
                        'phone'
                    ),
                    array(
                        'Email',
                        'email'
                    ),
                    [...]
                )
            )
        )
        [...]
    )
);

And you have the table tx_enterprise_domain_model_person with the two columns phones and emails. In phones the inline record address has no type select (see its foreign_types) but emails leaves this as configured in the inline record table above.

array(
    [...]
    'columns' => array(
        [...]
        'phones' => array(
            [...]
            'config' => array(
                'type' => 'inline',
                'foreign_table' => 'tx_enterprise_domain_model_address',
                'foreign_types' => array(
                    'phone' => array(
                        'showitem' => '
                                --palette--;;phone
                        '
                    )
                ),
                'foreign_record_defaults' => array(
                    'type' => 'phone'
                ),
                [...]
            )
        ),
        'emails' => array(
            [...]
            'config' => array(
                'type' => 'inline',
                'foreign_table' => 'tx_enterprise_domain_model_address',
                'foreign_record_defaults' => array(
                    'type' => 'email'
                ),
                [...]
            )
        )
    )
);

After creating a person and adding a new phone number and a email for that person, you see for each inline record the correct form; for phones this is only the input for a phone number, for emails this is the type select and a input for the email itself. But after saving the type value for the phones inline record is postal and not phone. So in this case foreign_record_defaults is only correctly stored when the corresponding field was rendered before. But the expectation would be that all values in foreign_record_defaults are stored in any case no matter if they rendered before or not.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #70904: IRRE: foreign_record_defaults for colPos gets trimmed Closed2015-10-21

Actions
Actions

Also available in: Atom PDF