Skip to content

Commit

Permalink
Fix #49: Allow custom tags to be added for both single select and mul…
Browse files Browse the repository at this point in the history
…tiple select
  • Loading branch information
kartik-v committed Jun 16, 2015
1 parent e0fff9c commit a59166b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version 2.0.1
- (bug #42): Fix plugin bug that prevents clearing Select2 input correctly.
- (enh #43): Code style and formatting fixes.
- (enh #44): Trigger custom event `krajeeselect2:cleared`.
- (enh #49): Allow custom tags to be added for both single select and multiple select.

version 2.0.0
=============
Expand Down
4 changes: 1 addition & 3 deletions Select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ public function init()
}
$multiple = ArrayHelper::getValue($this->pluginOptions, 'multiple', false);
unset($this->pluginOptions['multiple']);
$multiple = ArrayHelper::getValue($this->pluginOptions, 'tags', false) ? true :
ArrayHelper::getValue($this->options, 'multiple', $multiple);
$this->options['multiple'] = $multiple;
$this->options['multiple'] = ArrayHelper::getValue($this->options, 'multiple', $multiple);
if ($this->hideSearch) {
$css = ArrayHelper::getValue($this->pluginOptions, 'dropdownCssClass', '');
$css .= ' kv-hide-search';
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"kartik-v/yii2-krajee-base": "*"
"kartik-v/yii2-krajee-base": "~1.7"
},
"autoload": {
"psr-4": {
Expand Down

3 comments on commit a59166b

@magefad
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now get
llegal offset type
130 $this->data = $multiple ? array_combine($key, $val) : [$key => $val];

@kartik-v
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must check your settings propertly. If you are using SINGLE select (i.e. multiple = false) then your value cannot be an array.

@truth4oll
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have the same error "llegal offset type"
muliple option was moved to pluginOptions?

Please sign in to comment.