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:
Robbie Averill 2019-04-29 15:55:58 +12:00 committed by GitHub
commit b5ca874591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}