Bug #65965

Wrong $paramsList in FormEngine->getSingleField_typeInput

Added by Klaus Moser over 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Backend API
Target version:
Start date:
2015-03-24
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

Found a bug in line 1537 in method getSingleField_typeInput in class FormEngine:

Is:

$paramsList = '\'' . $PA['itemFormElName'] . '\',\'' . implode(',', $evalList) . '\',\'' . trim($config['is_in']) . '\',' . (isset($config['checkbox']) ? 1 : 0) . ',\'' . $config['checkbox'] . '\'';

Must be:

$paramsList = '\'' . $PA['itemFormElName'] . '\',\'' . implode(',', $evalList) . '\',\'' . trim($config['is_in']) . '\',' . ($checkboxIsset ? 1 : 0) . ',\'' . $config['checkbox'] . '\'';

If $config['checkbox'] is not set it gets set in line 1449ff.

if (!isset($config['checkbox'])) {
    $config['checkbox'] = '0';
    $checkboxIsset = FALSE;
} else {
    $checkboxIsset = TRUE;
}

So isset($config['checkbox'] is always true.

This causes the forth paramter of the JS method fieldGet to be always 1 and there is no possibility to allow the value 0 in an textfield that evaluates to an integer value.


Related issues

Related to TYPO3 Core - Bug #23763: Enable "clear input field" functionality by default Closed 2010-10-17
Related to TYPO3 Core - Bug #68303: Image width/height are displayed as 0 in backend for default dimensions Accepted

Associated revisions

Revision 4a089571 (diff)
Added by Markus Klein over 4 years ago

[BUGFIX] Allow value 0 in textfields with eval int

Fix a wrong JS parameter.

Releases: master, 6.2
Resolves: #65965
Change-Id: I8f85d2a5e9133c7da351821d0fd73a8c6a59b46f
Reviewed-on: http://review.typo3.org/38103
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Tymoteusz Motylewski <>
Reviewed-by: Jan Helke <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Benjamin Mack <>
Tested-by: Benjamin Mack <>

Revision 34dd1183 (diff)
Added by Markus Klein over 4 years ago

[BUGFIX] Allow value 0 in textfields with eval int

Fix a wrong JS parameter.

Releases: master, 6.2
Resolves: #65965
Change-Id: I8f85d2a5e9133c7da351821d0fd73a8c6a59b46f
Reviewed-on: http://review.typo3.org/38317
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Markus Klein over 4 years ago

Wow, great finding. Can you push a patch please to our review system?

All information can be found here http://wiki.typo3.org/CWT

#2 Updated by Markus Klein over 4 years ago

This bug dates back to #23763 (4 years)

#3 Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38103

#4 Updated by Markus Klein over 4 years ago

  • Assignee set to Markus Klein
  • Target version set to next-patchlevel
  • Complexity changed from easy to no-brainer

Please review the patch, test it and vote! Thanks.

#5 Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38317

#6 Updated by Markus Klein over 4 years ago

Can be tested on 6.2. Simply edit a content element and look at the Top Margin field. It is empty and you can't enter 0.
With the patch applied 0 is displayed, because it is the default value.

#7 Updated by Markus Klein over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF