mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed PHP Notices in TreeMultiSelectField
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65145 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6ef535d6ce
commit
c539687eb2
@ -58,6 +58,8 @@ HTML;
|
||||
function saveInto(DataObject $record) {
|
||||
// Detect whether this field has actually been updated
|
||||
if($this->value !== 'unchanged') {
|
||||
$items = array();
|
||||
|
||||
$fieldName = $this->name;
|
||||
$saveDest = $record->$fieldName();
|
||||
if(!$saveDest) user_error("TreeMultiselectField::saveInto() Field '$fieldName' not found on $record->class.$record->ID", E_USER_ERROR);
|
||||
@ -82,6 +84,8 @@ HTML;
|
||||
* Changes this field to the readonly field.
|
||||
*/
|
||||
function performReadonlyTransformation() {
|
||||
$titleArray = array();
|
||||
$titleList = array();
|
||||
if($items = $this->getItems()) {
|
||||
foreach($items as $item) $titleArray[] = $item->Title;
|
||||
if($titleArray) $titleList = implode(", ", $titleArray);
|
||||
|
Loading…
Reference in New Issue
Block a user