From 14e1e5e1fa43a0434c7692612eb3e72081f96603 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 19 Jan 2023 21:16:49 +1300 Subject: [PATCH] MNT Broken builds --- code/Model/EditableFormField/EditableLiteralField.php | 9 +++++---- .../EditableFormField/EditableMultipleOptionField.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/Model/EditableFormField/EditableLiteralField.php b/code/Model/EditableFormField/EditableLiteralField.php index 4f0ff49..cb00e93 100644 --- a/code/Model/EditableFormField/EditableLiteralField.php +++ b/code/Model/EditableFormField/EditableLiteralField.php @@ -11,6 +11,7 @@ use SilverStripe\Forms\CheckboxField; use SilverStripe\Forms\CompositeField; use SilverStripe\Forms\LiteralField; use SilverStripe\UserForms\Model\EditableFormField; +use SilverStripe\View\Parsers\HTMLValue; /** * Editable Literal Field. A literal field is just a blank slate where @@ -83,7 +84,7 @@ class EditableLiteralField extends EditableFormField } // Perform sanitisation - $htmlValue = Injector::inst()->create('HTMLValue', $content); + $htmlValue = Injector::inst()->create(HTMLValue::class, $content); $santiser = Injector::inst()->create(HTMLEditorSanitiser::class, $this->getEditorConfig()); $santiser->sanitise($htmlValue); return $htmlValue->getContent(); @@ -122,16 +123,16 @@ class EditableLiteralField extends EditableFormField $fields->removeByName(['Default', 'Validation', 'RightTitle']); $fields->addFieldsToTab('Root.Main', [ - HTMLEditorField::create('Content', _t(__CLASS__.'.CONTENT', 'HTML')) + HTMLEditorField::create('Content', _t(__CLASS__ . '.CONTENT', 'HTML')) ->setRows(4) ->setColumns(20), CheckboxField::create( 'HideFromReports', - _t(__CLASS__.'.HIDEFROMREPORT', 'Hide from reports?') + _t(__CLASS__ . '.HIDEFROMREPORT', 'Hide from reports?') ), CheckboxField::create( 'HideLabel', - _t(__CLASS__.'.HIDELABEL', "Hide 'Title' label on frontend?") + _t(__CLASS__ . '.HIDELABEL', "Hide 'Title' label on frontend?") ) ]); }); diff --git a/code/Model/EditableFormField/EditableMultipleOptionField.php b/code/Model/EditableFormField/EditableMultipleOptionField.php index cb9add6..7beffbd 100644 --- a/code/Model/EditableFormField/EditableMultipleOptionField.php +++ b/code/Model/EditableFormField/EditableMultipleOptionField.php @@ -103,7 +103,7 @@ class EditableMultipleOptionField extends EditableFormField $optionsConfig ); - $fields->insertAfter(Tab::create('Options', _t(__CLASS__.'.OPTIONSTAB', 'Options')), 'Main'); + $fields->insertAfter('Main', Tab::create('Options', _t(__CLASS__.'.OPTIONSTAB', 'Options'))); $fields->addFieldToTab('Root.Options', $optionsGrid); });