Problem/Motivation

After updating to 7.x-1.5 I get an error when pasting into wysiwyg + ckeditor.
Uncaught TypeError: Cannot read property 'getData' of undefined
#2552809: [legacy ckeditor plugin] ckeditor 4.5.x compatibility introduced a paste check and the dataTransfer isn't set for me.

      // Prevent paste, so the new clipboard plugin will not double insert the Atom.
      editor.on('paste', function (evt) {
        if (Drupal.dnd.sas2array(evt.data.dataTransfer.getData('Text'))) {
          return false;
        }
      });

Should we check if dataTransfer is set first? Or is something misconfigured on my end?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Tim Bozeman created an issue. See original summary.

Tim Bozeman’s picture

FileSize
663 bytes
Tim Bozeman’s picture

Issue summary: View changes
Tim Bozeman’s picture

nagy.balint’s picture

Hi, thanks for the patch.

What are you pasting into the editor when you get this error?

Otherwise it seems fine, but we should check with the typeof
typeof evt.data.dataTransfer !== 'undefined'

Tim Bozeman’s picture

FileSize
871 bytes
871 bytes

Thank you for the quick reply! I'm just pasting plain text to get the error.

nagy.balint’s picture

Status: Active » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

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