I have defined my own simple plugin using hook_wysiwyg_plugin() hook. Basically all it has to do is to provide the list of extended_valid_elements so that editor wouldn't cut them off from textaerea.

However, I noticed that elements which I've put into extended_valid_elements are not present in settings of wysisyg editor on the page - Drupal.settings.wysisyg.configs.tinymce.formatpanopoly_wysiwyg_text.extended_valid_elements

So I started my debugger. And here is what I've found:
panopoly_wysiwyg_alter_wysiwyg_editor_settings() (which is called from panopoly_wysiwyg_wysiwyg_editor_settings_alter()) plays with some params inside $settings array (among which is also extended_valid_elements). The block of code that screw everything is the following one:

        // When adding new elements to $settings['extended_valid_elements'], make sure
        // that we're merging, and not overwriting.
        $settings_array = array();
        foreach($settings['extended_valid_elements'] as $tag) {
          if (strpos("[", $tag) !== FALSE) {
            list($tag, $allowed_attributes) = explode('[', $tag);
            ...
          }
        }

some one had messed up order of params that are passed to strpos() func inside if() clause - haystack should be passed firts, needle - second, but not vise versa. Because of that code inside if() has no chances to be executed.

And here is the patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ruslan.muradov created an issue. See original summary.

ruslan.muradov’s picture

Issue summary: View changes
ruslan.muradov’s picture

Issue summary: View changes