Project

General

Profile

Actions

Bug #22457

closed

IRRE takes 100000 as default for TCA maxitems but it should be 1

Added by Jochen Rau over 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-04-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The default value of maxitems in TCA is documented in doc_core_api for the types "select", "group", and "inline": "Maximum number of items in the selector box. (Default = 1)"

But for type "inline" it is actually 100000. This causes massive problems if switching from type "select" (where it is actually 1) to type "inline". In Extbase "maxitems" is taken into account to determine the cardinality (1:1,1:n, m:n) of a relation.

The attached patch changes the default of "maxitems" for type "inline" to 1. But this will break a lot of existing extensions using IRRE! Because most of the developers set up their TCA without adding "maxitems" => 99999 to allow multiple records. They might not even know the maxitems should default to 1.

The patch is straight forward but the root cause is concealed. In t3lib_tceforms as well as in t3lib_tceforms_inline you find the following two lines:

$maxitems = t3lib_div::intInRange($config['maxitems'],0);
if (!$maxitems) $maxitems=100000;

But in t3lib_tceforms $config['maxitems'] can not be 0 or 1 because of

$maxitems = intval($config['maxitems']);
if ($maxitems<=1) {
$item = $this->getSingleField_typeSelect_single([...]);
} elseif (!strcmp($config['renderMode'],'checkbox')) {
[...]
}

some lines before. If $config['maxitems'] is not set in t3lib_tceforms_inline the function t3lib_div::intInRange($config['maxitems'],0); will return 0. And !$maxitems will be casted to FALSE (sometimes I really hate dynamically typed languages).
(issue imported from #M14113)


Files

bug_14113_v1.diff (855 Bytes) bug_14113_v1.diff Administrator Admin, 2010-04-14 22:39
Actions #1

Updated by Jochen Rau over 14 years ago

After a discussion in the core mailing list, we agreed to change the documentation instead to reflect this difference in behavior.

I have added this to the "Pending Document Wiki".

Actions #2

Updated by Susanne Moog over 13 years ago

  • Target version deleted (4.4.0)
Actions

Also available in: Atom PDF