From c70db75d38e1dcdfb97cc930c281f459fd983e60 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 23 Jul 2016 15:16:57 +1000 Subject: [PATCH] Pass the data set along with getOptions methods This is useful when the model is unreliable, because it is not always populated with the relevant data set. This argument is only needed in edge cases, like when using a repeater or other split class<->data scenarios Refs #2235 --- modules/backend/widgets/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index 95bc6d473..0d0f95327 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -1041,10 +1041,10 @@ class Form extends WidgetBase } if ($this->objectMethodExists($model, $methodName)) { - $fieldOptions = $model->$methodName($field->value); + $fieldOptions = $model->$methodName($field->value, $this->data); } else { - $fieldOptions = $model->getDropdownOptions($attribute, $field->value); + $fieldOptions = $model->getDropdownOptions($attribute, $field->value, $this->data); } } /*