diff --git a/src/Forms/FormField.php b/src/Forms/FormField.php index f77e33865..f19c6425e 100644 --- a/src/Forms/FormField.php +++ b/src/Forms/FormField.php @@ -978,12 +978,12 @@ class FormField extends RequestHandler { $context = $this; + $this->extend('onBeforeRender', $context, $properties); + if (count($properties)) { $context = $context->customise($properties); } - $this->extend('onBeforeRender', $this); - $result = $context->renderWith($this->getTemplates()); // Trim whitespace from the result, so that trailing newlines are supressed. Works for strings and HTMLText values