mirror of
https://github.com/silverstripe/silverstripe-tagfield
synced 2024-07-01 00:49:19 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e739275305 | ||
|
2c40955c2d |
|
@ -205,10 +205,20 @@ class StringTagField extends DropdownField {
|
||||||
|
|
||||||
$name = $this->getName();
|
$name = $this->getName();
|
||||||
|
|
||||||
$record->$name = join(',', $this->Value());
|
$record->$name = $this->dataValue();
|
||||||
$record->write();
|
$record->write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure that arrays are imploded before being saved
|
||||||
|
*
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
|
public function dataValue()
|
||||||
|
{
|
||||||
|
return implode(',', $this->value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a JSON string of tags, for lazy loading.
|
* Returns a JSON string of tags, for lazy loading.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user