Skip to content

Commit

Permalink
Merge pull request #170 from rubenarslan/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
cyriltata committed Jul 13, 2015
2 parents d922d54 + 06add79 commit 0727c7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Model/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,14 @@ protected function setMoreOptions() {
$this->classes_input[] = 'select2add';
$this->classes_input[] = 'form-control';
$for_select2 = array();

// Hack to split choices if comma separated and have only one element
// ASSUMPTION: choices are not suppose to have commas (weirdo)
$choice = current($this->choices);
if (count($this->choices) == 1 && strpos($choice, ',') !== false) {
$this->choices = explode(',', $choice);
}

foreach ($this->choices AS $option) {
$for_select2[] = array('id' => $option, 'text' => $option);
}
Expand Down

0 comments on commit 0727c7b

Please sign in to comment.