Skip to content

Commit 6fb2d41

Browse files
authored
Merge pull request #3192 from mahasadhu/mahasadhu-bugfix-values
Bugfix values function
2 parents 6e30428 + 1e37910 commit 6fb2d41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/Library/CrudPanel/CrudFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ public function label($value)
280280
* For example, the dropdown, select2 and select2 filters let the user select
281281
* pre-determined values to filter with. This is how to set those values that will be picked up.
282282
*
283-
* @param array $value Key-value array with values for the user to pick from.
283+
* @param array|function $value Key-value array with values for the user to pick from, or a function which also return a Key-value array.
284284
* @return CrudFilter
285285
*/
286286
public function values($value)
287287
{
288-
$this->values = $value;
288+
$this->values = (! is_string($value) && is_callable($value)) ? $value() : $value;
289289

290290
return $this->save();
291291
}

0 commit comments

Comments
 (0)