lib: Ignore required attribute on lists an checkboxes

References #1014
This commit is contained in:
logmanoriginal 2019-01-22 18:11:52 +01:00
parent ab2e566ee1
commit 434c12672f
2 changed files with 14 additions and 1 deletions

View file

@ -207,6 +207,11 @@ This bridge is not fetching its content through a secure connection</div>';
* @return string The list input field
*/
private static function getListInput($entry, $id, $name) {
if(isset($entry['required'])) {
Debug::log('The "required" attribute is not supported for lists.');
unset($entry['required']);
}
$list = '<select '
. self::getInputAttributes($entry)
. ' id="'
@ -267,6 +272,11 @@ This bridge is not fetching its content through a secure connection</div>';
* @return string The checkbox input field
*/
private static function getCheckboxInput($entry, $id, $name) {
if(isset($entry['required'])) {
Debug::log('The "required" attribute is not supported for checkboxes.');
unset($entry['required']);
}
return '<input '
. self::getInputAttributes($entry)
. ' id="'

View file

@ -196,7 +196,10 @@ class ParameterValidator {
if(isset($data[$id]) && !empty($data[$id])) {
$queriedContexts[$context] = true;
} elseif(isset($properties['required'])
&& $properties['required'] === true) {
&& $properties['required'] === true
&& isset($properties['type'])
&& $properties['type'] !== 'checkbox'
&& $properties['type'] !== 'list') {
$queriedContexts[$context] = false;
break;
}