Commit b665ec3d authored by alexpott's avatar alexpott

Issue #2389381 by swentel, daffie: Impossible to add images in WYSIWYG...

Issue #2389381 by swentel, daffie: Impossible to add images in WYSIWYG including in-place editing due to fatal error
parent 970ea07c
......@@ -48,7 +48,7 @@ public function buildForm(array $form, FormStateInterface $form_state, FilterFor
$form['#prefix'] = '<div id="editor-image-dialog-form">';
$form['#suffix'] = '</div>';
$editor = editor_load($filter_format->format);
$editor = editor_load($filter_format->id());
// Construct strings to use in the upload validators.
$image_upload = $editor->getImageUploadSettings();
......
......@@ -83,6 +83,13 @@ public function testLoading() {
$editor = entity_create('editor', array(
'format' => 'full_html',
'editor' => 'unicorn',
'image_upload' => array(
'status' => FALSE,
'scheme' => file_default_scheme(),
'directory' => 'inline-images',
'max_size' => '',
'max_dimensions' => array('width' => '', 'height' => ''),
)
));
$editor->save();
......@@ -118,6 +125,11 @@ public function testLoading() {
$this->assertTrue(count($format_selector) === 1, 'A single text format selector exists on the page.');
$specific_format_selector = $this->xpath('//select[contains(@class, "filter-list") and contains(@class, "editor") and @data-editor-for="edit-body-0-value"]');
$this->assertTrue(count($specific_format_selector) === 1, 'A single text format selector exists on the page and has the "editor" class and a "data-editor-for" attribute with the correct value.');
// Load the editor image dialog form and make sure it does not fatal.
$this->drupalGet('editor/dialog/image/full_html');
$this->assertResponse(200);
$this->drupalLogout($this->privilegedUser);
// Also associate a text editor with the "Plain Text" text format.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment