Issue Bug Closed

#65965Wrong $paramsList in FormEngine->getSingleField_typeInput

Klaus Moser 03/24/15, 09:57 updated 10/02/18, 11:45

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.

Reviews 2