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:
Ingo Schommer 2008-11-03 13:47:40 +00:00
parent 6ef535d6ce
commit c539687eb2

View File

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