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

  1. On the image bundle of the file entity, add a Long text (with filtered text) field
  2. Create a WYSIWYG profile for your default text format. Under "Basic Setup" uncheck "Enabled by default"
  3. While editing a piece of content, click "Enable rich-text"
  4. Click the "Add Media" button in the WYSIWYG
  5. In the modal, Upload or select an image from the Library and continue to the last step (the File entity edit)
  6. 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".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jojonaloha created an issue. See original summary.

jojonaloha’s picture

Status: Active » Needs review
FileSize
1.2 KB

The attached patch should fix this. The reason is that WYSIWYG calls getData() on the CKEDITOR.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 in status.

jojonaloha’s picture

Re-rolled patch, since the last one does not apply to the latest versions of Media.

joseph.olstad’s picture

Status: Needs review » Fixed

committed to 7.x-2.x dev

Status: Fixed » Closed (fixed)

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