mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Ensure forms/fields overridden by onBeforeRender() can override templates
This commit is contained in:
parent
e2cb683f14
commit
7f8f5afc91
@ -1555,7 +1555,7 @@ class Form extends ViewableData implements HasRequestHandler
|
|||||||
$context = $this;
|
$context = $this;
|
||||||
$this->extend('onBeforeRender', $context);
|
$this->extend('onBeforeRender', $context);
|
||||||
|
|
||||||
$return = $context->renderWith($this->getTemplates());
|
$return = $context->renderWith($context->getTemplates());
|
||||||
|
|
||||||
// Now that we're rendered, clear message
|
// Now that we're rendered, clear message
|
||||||
$context->clearMessage();
|
$context->clearMessage();
|
||||||
|
@ -927,7 +927,7 @@ class FormField extends RequestHandler
|
|||||||
$context = $context->customise($properties);
|
$context = $context->customise($properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $context->renderWith($this->getTemplates());
|
$result = $context->renderWith($context->getTemplates());
|
||||||
|
|
||||||
// Trim whitespace from the result, so that trailing newlines are suppressed. Works for strings and HTMLText values
|
// Trim whitespace from the result, so that trailing newlines are suppressed. Works for strings and HTMLText values
|
||||||
if (is_string($result)) {
|
if (is_string($result)) {
|
||||||
@ -962,7 +962,7 @@ class FormField extends RequestHandler
|
|||||||
$context = $context->customise($properties);
|
$context = $context->customise($properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $context->renderWith($this->getFieldHolderTemplates());
|
return $context->renderWith($context->getFieldHolderTemplates());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user