Merge pull request #7467 from open-sausages/pulls/4.0/adjust-field-onbeforerender

Adjust FormField::onBeforeRendor so that it can influence both context and passed properties
This commit is contained in:
Chris Joe 2017-10-12 12:11:32 +13:00 committed by GitHub
commit d876e36424
1 changed files with 2 additions and 2 deletions

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