mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Limit HtmlEditorField HTMLText casting note to existing fields
This prevents it from failing for proxied values like BlogEntryForm, where the field name doesn't exist, and rather gets processed and saved into a different field.
This commit is contained in:
parent
8f6451612b
commit
5ca9db5e5e
@ -95,7 +95,7 @@ class HtmlEditorField extends TextareaField {
|
||||
}
|
||||
|
||||
public function saveInto(DataObjectInterface $record) {
|
||||
if($record->escapeTypeForField($this->name) != 'xml') {
|
||||
if($record->hasField($this->name) && $record->escapeTypeForField($this->name) != 'xml') {
|
||||
throw new Exception (
|
||||
'HtmlEditorField->saveInto(): This field should save into a HTMLText or HTMLVarchar field.'
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user