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.
I stumbled across a javascript error "Uncaught TypeError: Cannot read property 'getData' of undefined".
Using
- Media 7.x-2.0-beta1
- WYSIWYG 7.x-2.2
- CKEditor 3.6.6..2
Steps to reproduce
- On the image bundle of the file entity, add a Long text (with filtered text) field
- Create a WYSIWYG profile for your default text format. Under "Basic Setup" uncheck "Enabled by default"
- While editing a piece of content, click "Enable rich-text"
- Click the "Add Media" button in the WYSIWYG
- In the modal, Upload or select an image from the Library and continue to the last step (the File entity edit)
- Clicking "Submit" on the last step will not do anything. You should see the javascript error in the developer console
There is a workaround: click "Enable rich-text" when on the last step and hit "Submit".
Comment | File | Size | Author |
---|---|---|---|
#3 | media-uncaught_typeerror-2574405-3.patch | 1.31 KB | jojonaloha |
| |||
#2 | media-uncaught_typeerror-2574405-2.patch | 1.2 KB | jojonaloha |
Comments
Comment #2
jojonaloha CreditAttribution: jojonaloha at Metal Toad commentedThe attached patch should fix this. The reason is that WYSIWYG calls
getData()
on theCKEDITOR.instances
for the file entity field, but there is no CKEditor instance since rich-text is disabled by default. WYSIWYG stores the state of each WYSIWYG instance instatus
.Comment #3
jojonaloha CreditAttribution: jojonaloha at Metal Toad commentedRe-rolled patch, since the last one does not apply to the latest versions of Media.
Comment #5
joseph.olstadcommitted to 7.x-2.x dev