Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff.txt | 871 bytes | Tim Bozeman |
#6 | scald_paste_2577125-6.patch | 871 bytes | Tim Bozeman |
#2 | scald_paste_2577125-2.patch | 663 bytes | Tim Bozeman |
Comments
Comment #2
Tim Bozeman CreditAttribution: Tim Bozeman at CyberSolution commentedComment #3
Tim Bozeman CreditAttribution: Tim Bozeman at CyberSolution commentedComment #4
Tim Bozeman CreditAttribution: Tim Bozeman at CyberSolution for Achieve Internet commentedComment #5
nagy.balint CreditAttribution: nagy.balint commentedHi, 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'
Comment #6
Tim Bozeman CreditAttribution: Tim Bozeman at CyberSolution for Achieve Internet commentedThank you for the quick reply! I'm just pasting plain text to get the error.
Comment #8
nagy.balint CreditAttribution: nagy.balint commentedThanks, committed.