Skip to content

Commit 68cd9b5

Browse files
committed
fixed issue when no type was preselected
1 parent b541460 commit 68cd9b5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lam/templates/upload/masscreate.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@
166166
foreach ($types as $type) {
167167
$typeList[$type->getAlias()] = $type->getId();
168168
}
169-
$selectedType = array();
169+
$selectedType = null;
170170
if (isset($_REQUEST['type'])) {
171-
$selectedType[] = $_REQUEST['type'];
171+
$selectedType = $_REQUEST['type'];
172172
}
173173
elseif (!empty($types)) {
174-
$selectedType[] = $types[0]->getId();
174+
$selectedType = $types[0]->getId();
175175
}
176-
$typeSelect = new htmlTableExtendedSelect('type', $typeList, $selectedType, _("Account type"));
176+
$typeSelect = new htmlTableExtendedSelect('type', $typeList, array($selectedType), _("Account type"));
177177
$typeSelect->setHasDescriptiveElements(true);
178178
$typeSelect->setOnchangeEvent('changeVisibleModules(this);');
179179
$table->addElement($typeSelect, true);
@@ -186,7 +186,7 @@
186186
$moduleGroup = new htmlGroup();
187187
foreach ($types as $type) {
188188
$divClasses = array('typeOptions');
189-
if ((!isset($_REQUEST['type']) && ($i != 0)) || (isset($_REQUEST['type']) && ($_REQUEST['type'] != $type->getId()))) {
189+
if ($selectedType != $type->getId()) {
190190
$divClasses[] = 'hidden';
191191
}
192192
$innerTable = new htmlTable();

0 commit comments

Comments
 (0)