only rows > 1 switches on multiple

in some places we have rows="1", which des nothing at all previously, removing it now
fixes errors e.g. in AB where the category filter returned [] (empty array) for "All addressbooks" causing a server-side PHP 8 error (Invalid index)
This commit is contained in:
ralf 2022-08-11 14:14:20 +02:00
parent 83df26d28b
commit 3d97fccb61

View File

@ -248,10 +248,14 @@ function send_template()
unset($attrs['expand_multiple_rows']); unset($attrs['expand_multiple_rows']);
} }
// <select rows="N" (to show N rows) previously also switched multiple on // <select rows="N" (to show N rows) previously also switched multiple on
if (!empty($attrs['rows'])) if (!empty($attrs['rows']) && (int)$attrs['rows'] > 1)
{ {
$attrs['multiple'] = true; $attrs['multiple'] = true;
} }
else
{
unset($attrs['rows']);
}
// automatic convert empty_label for multiple=true to a placeholder // automatic convert empty_label for multiple=true to a placeholder
if (!empty($attrs['empty_label']) && !empty($attrs['multiple'])) if (!empty($attrs['empty_label']) && !empty($attrs['multiple']))
{ {