From eff5c28f24d06d288ebdb6d95aaec99a56c9012e Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Wed, 11 Oct 2017 11:43:57 +1300 Subject: [PATCH] Adjust FormField::onBeforeRendor so that it can influence both context and passed properties Fixes #7466 --- src/Forms/FormField.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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