Bug #90148
closedremoveItems does not remove correctly with float values
0%
Description
Given you use float values in type select renderType selectSingle, e.G.
[$languageFile . 'fe_users.timezone.I.-12', -12],
[$languageFile . 'fe_users.timezone.I.-11', -11],
[$languageFile . 'fe_users.timezone.I.-10', -10],
[$languageFile . 'fe_users.timezone.I.-9.5', -9.5],
[$languageFile . 'fe_users.timezone.I.-9', -9],
[$languageFile . 'fe_users.timezone.I.-8', -8],
[$languageFile . 'fe_users.timezone.I.-7', -7],
[$languageFile . 'fe_users.timezone.I.-6', -6],
[$languageFile . 'fe_users.timezone.I.-5', -5],
[$languageFile . 'fe_users.timezone.I.-4.5', -4.5],
[$languageFile . 'fe_users.timezone.I.-4', -4],
[$languageFile . 'fe_users.timezone.I.-3.5', -3.5],
[$languageFile . 'fe_users.timezone.I.-3', -3],
[$languageFile . 'fe_users.timezone.I.-2', -2],
[$languageFile . 'fe_users.timezone.I.-1', -1],
[$languageFile . 'fe_users.timezone.I.0', 0],
[$languageFile . 'fe_users.timezone.I.1', 1],
[$languageFile . 'fe_users.timezone.I.2', 2],
[$languageFile . 'fe_users.timezone.I.3', 3],
[$languageFile . 'fe_users.timezone.I.3.5', 3.5],
[$languageFile . 'fe_users.timezone.I.4', 4],
[$languageFile . 'fe_users.timezone.I.4.5', 4.5],
[$languageFile . 'fe_users.timezone.I.5', 5],
[$languageFile . 'fe_users.timezone.I.5.5', 5.5],
[$languageFile . 'fe_users.timezone.I.5.75', 5.75],
[$languageFile . 'fe_users.timezone.I.6', 6],
[$languageFile . 'fe_users.timezone.I.6.5', 6.5],
[$languageFile . 'fe_users.timezone.I.7', 7],
[$languageFile . 'fe_users.timezone.I.8', 8],
[$languageFile . 'fe_users.timezone.I.9', 9],
[$languageFile . 'fe_users.timezone.I.9.5', 9.5],
[$languageFile . 'fe_users.timezone.I.10', 10],
[$languageFile . 'fe_users.timezone.I.11', 11],
[$languageFile . 'fe_users.timezone.I.11.5', 11.5],
[$languageFile . 'fe_users.timezone.I.12', 12],
[$languageFile . 'fe_users.timezone.I.12.75', 12.75],
[$languageFile . 'fe_users.timezone.I.13', 13],
[$languageFile . 'fe_users.timezone.I.14', 14],
And you try to remove a bunch of them like e.G.
TCEFORM.fe_users.timezone.removeItems = -12, -11, -10, -9.5, -9, -8, -7, -6, -5, -4.5, -4, -3.5, -3, -2, -1, 3.5, 4.5, 5.5, 5.75, 6.5, 7, 8, 9, 9.5, 10, 11, 11.5, 12, 12.75, 13, 14
AbstractItemProvider::removeItemsByRemoveItemsPageTsConfig does not remove all requested items.
Array(23 => Array
(
[0] => LLL:EXT:sf_register/Resources/Private/Language/locallang_be.xlf:fe_users.timezone.I.5.5
[1] => 5.5
));
Value 5.5 has an key in the array of 23 and is present in the list of items to remove but isset($removeItems[$itemValues1]) does not return true and that's why the item does not get removed.
Updated by Sebastian Fischer almost 5 years ago
Flipping the values/keys and check with in_array would fix this
$removeItems = array_flip($removeItems);
foreach ($items as $key => $itemValues) {
if (in_array($itemValues[1], $removeItems)) {
unset($items[$key]);
}
}
Updated by Susanne Moog over 4 years ago
- Category set to FormEngine aka TCEforms
Updated by Georg Ringer 5 months ago
- Status changed from New to Accepted
can be easily tested with
TCEFORM.pages.sitemap_priority.removeItems = 0.6,0.0
Updated by Gerrit Code Review 5 months ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85136