Adjust FormField::onBeforeRendor so that it can influence both context and passed properties

Fixes #7466
This commit is contained in:
Damian Mooyman 2017-10-11 11:43:57 +13:00
parent c09dec5958
commit eff5c28f24
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -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