After a recent upgrade to Media 7.x-2.0-alpha3+80-dev and File Entity 7.x-2.0-alpha3+18-dev its impossible to insert a Document in Wysiwyg.
The popup displays an error and if we dive into the logs its these errors:
EntityMalformedException: Missing bundle in object of type file. i entity_extract_ids() (line 7721 in /MYPATH/includes/common.inc).
Creating default object from empty value i media_file_displays_alter() (line 1036 in /MYPATH/sites/all/modules/media/media.module).
Trying to get property of non-object i file_view_file() (line 226 in /MYPATH/sites/all/modules/file_entity/file_entity.file_api.inc).
Undefined index: #entity i media_wysiwyg_view_mode_form_alter() (line 98 in /MYPATH/sites/all/modules/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.module).
This does not happen with Images, only with Documents (and possibly other types, I don't know).
This is what the form options look like that get passed into the function:
Array
(
[#type] => fieldset
[#title] => options
[format] => Array
(
[#type] => select
[#title] => Display as
[#options] => Array
(
[default] => Förvald
[teaser] => Förhandstitt
[preview] => Förhandsgranska
[wysiwyg] => WYSIWYG
)
[#default_value] => default
[#description] => Choose the type of display you would like for this
file. Please be aware that files may display differently than they do when
they are inserted into an editor.
)
[fields] => Array
(
[#parents] => Array
(
)
[#pre_render] => Array
(
[0] => _field_extra_fields_pre_render
)
[#entity_type] => file
[#bundle] => testtype
)
)| Comment | File | Size | Author |
|---|---|---|---|
| #8 | media-brokendocument-2262107-8.patch | 644 bytes | dshields |
| #5 | media-brokendocument-2262107-5.patch | 644 bytes | rikki_iki |
Comments
Comment #1
cato commentedPatch from #18 in https://drupal.org/node/2223455 did the trick!
Someone can go ahead and close this issue.
Comment #2
devin carlson commentedClosing as a duplicate of #2223455: Broken Media WYSIWYG integration per #1.
Comment #3
rikki_iki commentedNot sure if this the right place, but I'm getting a similar problem only related to documents, but mine's a javascript error.
I can upload document but the final submit button throws this JS error:
Uncaught TypeError: Cannot read property 'tagName' of undefined media_wysiwyg.filter.js line 131
I have Media 7.x-2.0-alpha3+108-dev and File Entity 7.x-2.0-alpha3+31-dev
The patch referred to in #1 has already been committed to this version of media_wysiwyg so this is possibly a new bug.
I was able to resolve the issue with the attached patch.
Comment #5
rikki_iki commentedBetter patch.
Comment #6
dave reidComment #7
dshields commentedPatch in #5 works for me.
Comment #8
dshields commentedHere's the same patch, rolled against the latest dev branch.
Comment #9
dshields commentedComment #10
broeker commentedOddly, we were having the same issue as #3 and this patch does in fact solve that problem:
Uncaught TypeError: Cannot read property 'tagName' of undefined
There are several other issues/patches out there for that specific issue, but we had a unique situation in that the error was ONLY triggered in the context of an IPE modal dialog. Everything worked fine on a normal textarea field on a node edit etc. Nonetheless it would be great to have this committed.
For reference, the patch in this issue fixes the issue referenced below (whereas the recommended patch did not):
https://www.drupal.org/node/2317519
Again this is only for IPE/modal dialogs in our case, but now working.
Comment #11
broeker commentedComment #12
marty2081 commentedI can also confirm that the patch in #8 works in our case (the "Uncaught TypeError: Cannot read property 'tagName' of undefined" error popping up using IPE).
Comment #13
izmeez commentedI am wondering if this issue is related to #2317519: Blank WYSIWYG with existing multiple Media content
Comment #14
dshields commentedit looks like this is fixed in the latest stable release.
Comment #15
joseph.olstad@dshields, thansk for the followup
btw, latest recipe: https://www.drupal.org/node/2843391