mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Ensure forms/fields overridden by onBeforeRender() can override templates
This commit is contained in:
parent
e2cb683f14
commit
7f8f5afc91
src/Forms
@ -1555,7 +1555,7 @@ class Form extends ViewableData implements HasRequestHandler
|
||||
$context = $this;
|
||||
$this->extend('onBeforeRender', $context);
|
||||
|
||||
$return = $context->renderWith($this->getTemplates());
|
||||
$return = $context->renderWith($context->getTemplates());
|
||||
|
||||
// Now that we're rendered, clear message
|
||||
$context->clearMessage();
|
||||
|
@ -927,7 +927,7 @@ class FormField extends RequestHandler
|
||||
$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
|
||||
if (is_string($result)) {
|
||||
@ -962,7 +962,7 @@ class FormField extends RequestHandler
|
||||
$context = $context->customise($properties);
|
||||
}
|
||||
|
||||
return $context->renderWith($this->getFieldHolderTemplates());
|
||||
return $context->renderWith($context->getFieldHolderTemplates());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user