I'm using the media module with WYSIWYG with the CKEditor editor.

In media's WYSIWYG plugin, they pass both "css file" and "css path" as null.

In the wysiwyg_ckeditor_proxy_plugin_settings function, the following appears :

// @todo These should only be set if the plugin defined them.
'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'],

The end result of is that there is a <link /> added to the CKEditor's iframe that points at the root of the site.

I found this because I was trying to read some DSM calls, and they were all being eaten when a WYSIWYG appeared on a page. I think this is because the dsm output was being output to the front page that loads in the background.

This can be fixed by reworking this function to the following :

    // Populate required plugin settings.
    $settings[$name] = $plugin['dialog settings'] + array(
      'title' => $plugin['title'],
      'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'],
      'iconTitle' => $plugin['icon title'],
    );

    // CSS should only be set if the plugin defines it.
    if( isset( $plugin['css path'], $plugin['css file'] ) ) {
      $settings[$name]['css'] = base_path() . $plugin['css path'] . '/' . $plugin['css file'];
    }

While I'm using 2.2, I checked the latest dev branch and note the problem is there as well.

CommentFileSizeAuthor
#2 wysiwyg-ckeditor-blank-css.2054885.2.patch763 bytesTwoD
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TwoD’s picture

Oh, right, we should definitely add a not-empty check there. (An empty string still counts as set.)

TwoD’s picture

Issue summary: View changes

fixing up formatting mistakes

TwoD’s picture

Status: Active » Fixed
FileSize
763 bytes

Committed this patch to all branches.

Thanks for reporting this and sorry for the long delay!

Status: Fixed » Closed (fixed)

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