Open patricknelson opened 5 years ago
QQ: When issuing a PR, should this be submitted against the latest dot release (e.g. 4.4
) or against 4
?
We usually consider these "should use injector" changes as non-breaking bug-fixes. You should be fine to target 4.4
(or 4.3
if you want to affect any future patch releases for the 4.3
line too).
Affected Version
All versions of SS 4.x. (and 3.x but this cannot be fixed there due to maintenance schedule)
Description
When automatically generating an editor form for
DataObject
's for anHTMLText
type, SilverStripe will instantiateHTMLEditorField
directly using thenew
keyword instead of passing it through theInjector
via::create()
like it should.See: https://github.com/silverstripe/silverstripe-framework/blob/3e90fdf42f3306d9de739edee807175538f10d88/src/ORM/FieldType/DBHTMLText.php#L206
Relates to https://github.com/silverstripe/silverstripe-cms/pull/2050
Steps to Reproduce
CustomHtmlEditorField
that extendsHtmlEditorField
and configure it in the injector, e.g.DataObject
with a'ExampleContent' => 'HTMLText'
field.DataObject
you created, the default frameworkHtmlEditorField
is instantiated and used in the form instead of your custom editorCustomHtmlEditorField
.