Skip to content

Commit 3c4efb5

Browse files
committed
HP-2344
1 parent 9afdcf1 commit 3c4efb5

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

config/bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
error_reporting(YII_ENV === 'prod'
3131
? E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING
3232
# XXX to be fixed to E_ALL & ~E_NOTICE & ~E_STRICT for non prod
33-
: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING
33+
: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
3434
);
3535

3636
require_once WEBAPP_VENDOR_DIR . '/yiisoft/yii2/Yii.php';

src/models/Ref.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public static function getList($name, $translate = null, $options = [])
4747
$from = ArrayHelper::remove($mapOptions, 'from', 'name');
4848
$to = ArrayHelper::remove($mapOptions, 'to', 'label');
4949
$group = ArrayHelper::remove($mapOptions, 'group', null);
50+
$refs = ArrayHelper::map($models, $from, $to, $group);
51+
if (!empty($refs) && is_iterable($refs)) {
52+
asort($refs);
53+
}
5054

51-
return ArrayHelper::map($models, $from, $to, $group);
55+
return $refs;
5256
}
5357

5458
public static function getListRecursively($name, $translate = null, $options = [])

src/widgets/SearchManagedField.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function init(): void
4242
];
4343
}
4444
$buttonDropdown = ButtonDropdown::widget([
45-
'label' => Html::tag('span', implode('_', array_filter([$this->attribute, $condition->value])), ['class' => 'condition']),
45+
'label' => Html::tag('span', implode('_', array_filter(array_unique([$this->attribute, $condition]))), ['class' => 'condition']),
4646
'options' => ['class' => 'btn-default btn-sm'],
4747
'encodeLabel' => false,
4848
'dropdown' => [
@@ -77,13 +77,13 @@ private function currentCnd(): array
7777
foreach ($this->getVariants() as $searchVariant) {
7878
$attributeName = empty($searchVariant) ? $this->attribute : $this->attribute . '_' . $searchVariant->value;
7979
if ($param === $attributeName) {
80-
return [$searchVariant, $value];
80+
return [$searchVariant->value, $value];
8181
}
8282
}
8383
}
8484
}
8585

86-
return [$this->attribute, $queryParams[$this->attribute] ?? ''];
86+
return [$this->attribute, $queryParams[$this->attribute] ?? null];
8787
}
8888

8989
private function registerClientScript(): void

src/widgets/TagsInput.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function buildActiveInput(): string
7979
{
8080
return Html::activeHiddenInput($this->model, $this->attribute, [
8181
'v-model' => 'value',
82-
'value' => null,
82+
'value' => '',
8383
'data' => [
8484
'value' => $this->getValue(),
8585
'options' => Json::encode($this->buildOptions()),

0 commit comments

Comments
 (0)