Commit 5f79a75c authored by webchick's avatar webchick

Issue #2263351 by Wim Leers: Text Editor's in-place editing plugin broke...

Issue #2263351 by Wim Leers: Text Editor's in-place editing plugin broke in-place editing at large due to PHP fatal.
parent a0961ff6
......@@ -78,10 +78,11 @@ public function getAttachments() {
// Filter the current user's formats to those that support inline editing.
$formats = array();
foreach ($user_format_ids as $format_id) {
$editor = editor_load($format_id);
$editor_id = $editor->getEditor();
if ($editor && isset($definitions[$editor_id]) && isset($definitions[$editor_id]['supports_inline_editing']) && $definitions[$editor_id]['supports_inline_editing'] === TRUE) {
$formats[] = $format_id;
if ($editor = editor_load($format_id)) {
$editor_id = $editor->getEditor();
if (isset($definitions[$editor_id]['supports_inline_editing']) && $definitions[$editor_id]['supports_inline_editing'] === TRUE) {
$formats[] = $format_id;
}
}
}
......
......@@ -104,6 +104,14 @@ public function setUp() {
'editor' => 'unicorn',
));
$editor->save();
// Also create a text format without an associated text editor.
entity_create('filter_format', array(
'format' => 'no_editor',
'name' => 'No Text Editor',
'weight' => 2,
'filters' => array(),
))->save();
}
/**
......@@ -179,6 +187,17 @@ public function testMetadata() {
$this->assertEqual($expected, $metadata, 'The correct metadata (including custom metadata) is generated.');
}
/**
* Tests in-place editor attachments when the Editor module is present.
*/
public function testAttachments() {
$this->editorSelector = $this->container->get('quickedit.editor.selector');
$editors = array('editor');
$attachments = $this->editorSelector->getEditorAttachments($editors);
$this->assertIdentical($attachments, array('library' => array('editor/quickedit.inPlaceEditor.formattedText')), "Expected attachments for Editor module's in-place editor found.");
}
/**
* Tests GetUntransformedTextCommand AJAX command.
*/
......
......@@ -49,11 +49,6 @@
*
* @see example.sites.php
* @see conf_path()
*
* In addition to customizing application settings through variables in
* settings.php, you can create a services.yml file in the same directory to
* register custom, site-specific service definitions and/or swap out default
* implementations with custom ones.
*/
/**
......
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