mirror of
https://github.com/silverstripe/silverstripe-tagfield
synced 2024-10-22 11:05:32 +02:00
Merge pull request #142 from SilverStripers/fix/source-list-queries
fixed the issue with filters being taken off from rendering values
This commit is contained in:
commit
b5ca874591
@ -275,7 +275,7 @@ class TagField extends DropdownField
|
||||
|
||||
if ($values) {
|
||||
if (is_array($values)) {
|
||||
$values = DataList::create($dataClass)->filter($titleField, $values);
|
||||
$values = $source->filter($titleField, $values);
|
||||
}
|
||||
}
|
||||
if ($onlySelected) {
|
||||
@ -390,6 +390,9 @@ class TagField extends DropdownField
|
||||
$record = Injector::inst()->create($dataClass);
|
||||
$record->{$titleField} = $term;
|
||||
$record->write();
|
||||
if ($source instanceof SS_List) {
|
||||
$source->add($record);
|
||||
}
|
||||
return $record;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user