Project

General

Profile

Actions

Bug #80068

closed

Type value (?) from database record not defined in TCA of table

Added by Christoph Dörfel about 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2017-03-01
Due date:
% Done:

0%

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

Description

DatabaseRecordTypeValue->addData() throws an exception if $recordTypeValue could not be found.

This happens for records that are not in the default language with no l10n_parent (i.e. l10n_parent = 0), have a TCA field configuration with multiple types but no default type "0" and a TCA field configuration with "l10n_mode = exclude" set.

DatabaseRecordTypeValue->getValueFromDefaultLanguageRecordIfConfigured() returns null since $result['defaultLanguageRow'] is null and there's no null check in place.

Sample TCA:

'tx_extbase_type' => [
    'exclude' => 1,
    'l10n_mode' => 'exclude',
    'label' => 'Extbase type',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectSingle',
        'items' => [
            ['Type A, 'Tx_Extension_Domain_Model_A'],
            ['Type B', 'Tx_Extension_Domain_Model_B']
        ],
        'size' => 1,
        'maxitems' => 1,
        'default' => 'Tx_Extension_Domain_Model_A'
    ]
]

Actions #1

Updated by Christian Kuhn about 7 years ago

  • Status changed from New to Needs Feedback

mmmh, a record not in default language with l10n_parent = 0 and then having l10n_mode=exclude does not make sense.

Actions #2

Updated by Christoph Dörfel about 7 years ago

Christian Kuhn wrote:

mmmh, a record not in default language with l10n_parent = 0 and then having l10n_mode=exclude does not make sense.

Haha, yes.
Although records in the database and the TCA configuration should somehow match, a user might be able to change the sys_language_uid of a record (from default to something > 0). After that the user can never undo his mistake because of the "Uncaught TYPO3 Exception" and is stuck with a broken record.

From the TCA Reference Documentation:

l10n_mode = exclude – Field will not be shown in TCEforms if this record is a localization of the default language.

So the field should be shown since the record is not a localization of the default language. It's no a record in the default language either, but that's another story.

Actions #3

Updated by Oliver Hader almost 7 years ago

  • Category changed from DataHandler aka TCEmain to FormEngine aka TCEforms
Actions #4

Updated by Alexander Opitz over 6 years ago

  • Status changed from Needs Feedback to New
Actions #5

Updated by Benni Mack about 4 years ago

  • Status changed from New to Closed

Hey all,

I guess this is fixed in TYPO3 v8 now with our streamlined language synchronization parameter. If you feel this is still an issue, let me know, and I will re-open the issue.

Actions

Also available in: Atom PDF