Project

General

Profile

Actions

Bug #96069

closed

TCA Input field validator

Added by JAKOTA Design Group GmbH almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2021-11-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Hi, I'm running into this error:

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Undefined array key "value" in /var/www/html/public/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 1737

TCA Setup

'email' => [
'exclude' => true,
'label' => 'Email',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'nospace,email,required',
'default' => '',
],
],

Saving the form with something other than an email.

This
// Skip range validation, if the default value equals 0 and the input value is 0, "0" or an empty string.
// This is needed for timestamp date fields with ['range']['lower'] set.
$skipRangeValidation =
isset($tcaFieldConf['default'])
&& (int)$tcaFieldConf['default'] === 0
&& ($res['value'] === '' || $res['value'] === '0' || $res['value'] === 0);

need to be that way

// Skip range validation, if the default value equals 0 and the input value is 0, "0" or an empty string.
// This is needed for timestamp date fields with ['range']['lower'] set.
$skipRangeValidation =
isset($tcaFieldConf['default']) && isset($res['value'])
&& (int)$tcaFieldConf['default'] === 0
&& ($res['value'] === '' || $res['value'] === '0' || $res['value'] === 0);

Thanks

Actions

Also available in: Atom PDF