Fix wrong default value for add group member modal

This commit is contained in:
Frederic Guillot
2017-01-22 18:00:02 -05:00
parent daffcd5fd6
commit 9b9543353f

View File

@@ -3,6 +3,9 @@
</div> </div>
<?php if (empty($users)): ?> <?php if (empty($users)): ?>
<p class="alert"><?= t('There is no user available.') ?></p> <p class="alert"><?= t('There is no user available.') ?></p>
<div class="form-actions">
<?= $this->url->link(t('Close this window'), 'GroupListController', 'index', array(), false, 'btn js-modal-close') ?>
</div>
<?php else: ?> <?php else: ?>
<form method="post" action="<?= $this->url->href('GroupListController', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off"> <form method="post" action="<?= $this->url->href('GroupListController', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?> <?= $this->form->csrf() ?>
@@ -12,7 +15,7 @@
<?= $this->app->component('select-dropdown-autocomplete', array( <?= $this->app->component('select-dropdown-autocomplete', array(
'name' => 'user_id', 'name' => 'user_id',
'items' => $users, 'items' => $users,
'defaultValue' => isset($values['user_id']) ? $values['user_id'] : null, 'defaultValue' => isset($values['user_id']) ? $values['user_id'] : key($users),
)) ?> )) ?>
<?= $this->modal->submitButtons() ?> <?= $this->modal->submitButtons() ?>