From 524d7a90117d447bc7705066500b1637aa75f0e0 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 14 Oct 2008 19:31:18 +0000 Subject: [PATCH] ENHANCEMENT Disrecard $includeRelations setting when scaffolding $has_one relationships in FormScaffolder - use $restrictFields to limit instead BUGFIX Using fieldLabel() for $has_one relationships in FormScaffolder git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64224 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/FormScaffolder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forms/FormScaffolder.php b/forms/FormScaffolder.php index c0d77f40e..1b65034d7 100644 --- a/forms/FormScaffolder.php +++ b/forms/FormScaffolder.php @@ -89,10 +89,11 @@ class FormScaffolder extends Object { } // add has_one relation fields - if($this->obj->has_one() && ($this->includeRelations === true || isset($this->includeRelations['has_one']))) { + if($this->obj->has_one()) { foreach($this->obj->has_one() as $relationship => $component) { if($this->restrictFields && !in_array($relationship, $this->restrictFields)) continue; $hasOneField = $this->obj->dbObject("{$relationship}ID")->scaffoldFormField(null, $this->getParamsArray()); + $hasOneField->setTitle($this->obj->fieldLabel($relationship)); if($this->tabbed) { $fields->addFieldToTab("Root.Main", $hasOneField); } else {