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:
commit
d876e36424
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue