From 68cd9b53aa8e1e1d4fa5adfdebafbb5269ebc401 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 13 Dec 2017 11:06:57 +0100 Subject: [PATCH] fixed issue when no type was preselected --- lam/templates/upload/masscreate.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lam/templates/upload/masscreate.php b/lam/templates/upload/masscreate.php index 55640082..e54eef8a 100644 --- a/lam/templates/upload/masscreate.php +++ b/lam/templates/upload/masscreate.php @@ -166,14 +166,14 @@ $typeList = array(); foreach ($types as $type) { $typeList[$type->getAlias()] = $type->getId(); } -$selectedType = array(); +$selectedType = null; if (isset($_REQUEST['type'])) { - $selectedType[] = $_REQUEST['type']; + $selectedType = $_REQUEST['type']; } elseif (!empty($types)) { - $selectedType[] = $types[0]->getId(); + $selectedType = $types[0]->getId(); } -$typeSelect = new htmlTableExtendedSelect('type', $typeList, $selectedType, _("Account type")); +$typeSelect = new htmlTableExtendedSelect('type', $typeList, array($selectedType), _("Account type")); $typeSelect->setHasDescriptiveElements(true); $typeSelect->setOnchangeEvent('changeVisibleModules(this);'); $table->addElement($typeSelect, true); @@ -186,7 +186,7 @@ $table->addElement($moduleLabel); $moduleGroup = new htmlGroup(); foreach ($types as $type) { $divClasses = array('typeOptions'); - if ((!isset($_REQUEST['type']) && ($i != 0)) || (isset($_REQUEST['type']) && ($_REQUEST['type'] != $type->getId()))) { + if ($selectedType != $type->getId()) { $divClasses[] = 'hidden'; } $innerTable = new htmlTable();