Skip to content

Commit

Permalink
Reintroduce statement for $editorField resolving correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Jul 22, 2019
1 parent d23f3fc commit 6b28dd9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Forms/EditFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ protected function getFormFields(RequestHandler $controller = null, $name, $cont
$fields = parent::getFormFields($controller, $name, $context);

// Configure a slimmed down HTML editor for use with blocks
/** @var HTMLEditorField $editorField */
/** @var HTMLEditorField|null $editorField */
$editorField = $fields->fieldByName('Root.Main.HTML');
$editorField->setRows(7);
if ($editorField) {
$editorField->setRows(7);

$editorConfig = $editorField->getEditorConfig();
$editorConfig = $editorField->getEditorConfig();

// Only configure if the editor is TinyMCE
if ($editorConfig instanceof TinyMCEConfig) {
$editorConfig->setOption('statusbar', false);
$editorField->setEditorConfig($editorConfig);
// Only configure if the editor is TinyMCE
if ($editorConfig instanceof TinyMCEConfig) {
$editorConfig->setOption('statusbar', false);
$editorField->setEditorConfig($editorConfig);
}
}

return $fields;
Expand Down

0 comments on commit 6b28dd9

Please sign in to comment.