If you use the the "Kitchen Sink" TinyMCE plug-in with custom, non-Panopoly input formats, the WYSIWYG editor spits out JavaScript errors and causes the related fields to not show up, becoming uneditable.

This is a particular problem for old sites that upgraded to Panopoly, in which the old Input Formats mimic the Panopoly WYSIWYG editor for consistency.

Steps to reproduce:
1) Install Panopoly.
2) Create a new 'full HTML' input format.
3) Assign TinyMCE to be the input format's WYSIWYG editor.
4) Copy the settings from the "WYSIWYG" format's editor.
5) Create a new node.
6) Switch the body's input to use the new 'full HTML' format.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lsolesen’s picture

Could you test with latest dev.

jdearie’s picture

Issue summary: View changes

I was able to reproduce this issue using the steps provided. I was working on 7.x-1.6 on a fresh Panopoly distro. On a Mac, using Chrome, I don't see any javascript errors, but the entire body field does disappear.

Switching back to the Panopoly WYSIWYG format does not correct the problem - but switching to the HTML format and then the Panopoly WYSIWYG does bring the body field back.

After removing the Kitchen Sink plug-in from the new custom format removed the problem.

  • dsnopek committed 44c9930 on 7.x-1.x
    Update Panopoly WYSIWYG for #2058917 by kmonty: Fixed Kitchen Sink...
dsnopek’s picture

Status: Active » Fixed

I've committed a change which will prevent user created formats that enable the 'Kitchen Sink' plugin to at least not error out, by disabling the plugin if the additional configuration necessary for the plugin is missing.

However, if you want your text format to have the same configuration as Panopoly's, you can implement an extra hook in your module like this:

/**
 * Implements hook_wysiwyg_editor_settings_alter().
 */
function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->format == 'mymodule_wysiwyg_text') {
    panopoly_wysiwyg_alter_wysiwyg_editor_settings($settings, $context);
  }
}

The above API function was added in #1846322: Switching between TinyMCE text formats causes textarea to disappear

It'd be great to have some automated tests for user created text formats, so we can stop breaking this. :-) I've created a new issue for that: #2334373: Write Behat tests to make sure that user created text formats and WYSIWYG profiles work

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

scottalan’s picture

This broke a custom text format for me that I'm using ckeditor in.

The culprit:

commit ffbaf9bf66696bc9906f7e96aa290ffcb9768fad
Author: David Snopek <dsnopek@gmail.com>
Date:   Sun Sep 7 14:56:48 2014 +0100

    Issue #2058917 by kmonty: Fixed Kitchen Sink WYSIWYG plug-in breaks non-panopoly_wysiwyg input format editors.

Here's a patch that makes sure we are dealing with TinyMCE. It fixes the broken editor for me and doesn't have any repercussions that have been stated here and https://www.drupal.org/node/1846322.

Not sure if this is way off base but had to get something done due to the fact I have updated our production sites due to the latest Security release for Drupal core and Panopoly 1.13 broke our editors.

Let me know what you think

dsnopek’s picture

Status: Closed (fixed) » Needs review
FileSize
696 bytes

Hrm! We seem never able to win on this issue. :-/

Here is an alternative patch that will skip that entire code block if the editor is not TinyMCE. Can you test it and let me know if it works for you? This is a big enough deal that I'll probably make a release once we have a fix.

Again, it would be awesome to get some automated tests for custom text formats so we can stop breaking this: #2334373: Write Behat tests to make sure that user created text formats and WYSIWYG profiles work

scottalan’s picture

I've tested this and it seems to be fine. Thanks

dsnopek’s picture

Title: Kitchen Sink WYSIWYG plug-in breaks non-panopoly_wysiwyg input format editors » Kitchen Sink WYSIWYG plug-in breaks non-panopoly_wysiwyg input format editors (using CKEditor)
Status: Needs review » Fixed

Thanks! I've committed it and will think about doing a release soon-ish.

  • dsnopek committed a6582aa on 7.x-1.x
    Update Panopoly WYSIWYG for #2058917 by dsnopek, scottalan | kmonty:...
dsnopek’s picture

Status: Needs review » Fixed

Not sure how this got unmarked as Fixed. :-/

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

g3r4’s picture

Patch posted on comment #7 worked for me. Thanks