Use get_by_id on display rules model loads to ensure they get cached

This commit is contained in:
Robbie Averill 2017-06-21 14:14:17 +12:00
parent 630c5c3395
commit f24af09f00

View File

@ -455,7 +455,7 @@ class UserDefinedForm_Controller extends Page_Controller
foreach ($field->EffectiveDisplayRules() as $rule) { foreach ($field->EffectiveDisplayRules() as $rule) {
// Get the field which is effected // Get the field which is effected
$formFieldWatch = EditableFormField::get()->byId($rule->ConditionFieldID); $formFieldWatch = DataObject::get_by_id('EditableFormField', $rule->ConditionFieldID);
// Skip deleted fields // Skip deleted fields
if (!$formFieldWatch) { if (!$formFieldWatch) {