I switched from Alpha to Dev-branch of Media and File-Entity today which causes the following error-messages with WYSIWYG-editing for images and video-files (Vimeo):
Notice: Undefined index: file in media_wysiwyg_view_mode_form_alter() (line 97 of /MY_PATH_TO/sites/all/modules/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.module).
Notice: Trying to get property of non-object in file_view_file() (line 226 of /MY_PATH_TO/sites/all/modules/file_entity/file_entity.file_api.inc).
Warning: Creating default object from empty value in media_file_displays_alter() (line 1037 of /MY_PATH_TO/sites/all/modules/media/media.module).
EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7721 of /MY_PATH_TO/includes/common.inc).
File entity
7.x-2.0-alpha3+13-dev
Media
7.x-2.0-alpha3+77-dev
Media: Vimeo
7.x-2.0-rc1+7-dev
Wysiwyg
7.x-2.2+33-dev
CKEditor 4.3.3.7841b02
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | media-brokenwysiwyg-2223455-18.patch | 630 bytes | das-peter |
Comments
Comment #1
Aslak commentedHad the same issue. Making this fix solved it for me. Looks like the cause is a pass by reference/value error introduced in bd2a854c.
Comment #2
esomething commentedThe patch fixed the problem for me too. Thanks!
Comment #3
esomething commentedWell it fixed it for images but broke it for videos.
Comment #4
lorique commentedComment #5
Aslak commentedThe error is caused by me running php 5.4, which is unsupported. The resolution is to downgrade to php 5.3. Disregard the patch.
Comment #6
lorique commentedChanged status
Comment #7
jmuzz commentedDoes it say somewhere that 5.4 isn't supported?
This seems like a reasonable solution to me. I'm not sure the video problems esomething saw are related to WYSIWYG. I can't even put something in a video field with the new versions, but this patch does seem to work for images in WYSIWYG.
Comment #8
jmuzz commentedI managed to get a video attached to a field by browsing it and then submitting the node form without hitting the attach button first (which causes errors for me). Once that was done the video was in my library and I was able to embed it in the WYSIWYG by choosing it from there, but only if this patch is applied. Without it I got the same error as with images.
Comment #9
sylus commentedI just updated a fairly recent dev version (0d39e26) of media to latest dev (b2c2d78) and started getting this issue with my behat tests.
This patch fixed all issues.
Comment #10
devin carlson commentedThanks for the patch!
Can someone post the steps to reproduce this using a fresh install of Media 7.x-2.x-dev? I'm not able to reproduce this locally and it would be great if I could add additional test coverage along with the changes in #1.
Comment #11
dw72 commentedI have the same issue when try to simply add image in ckeditor using wysiwyg module (fresh upload or from media library... no matter) with latest dev of file_entity and media.
Comment #12
marcoka commentedi get "EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7721 of /MY_PATH_TO/includes/common.inc)." withg my media 2.x-devtesting the patch now
Comment #13
aaron commentedComment #14
sylus commentedI am not sure the issue in #12 is related to this issue. Once you remove this patch your missing entity of type file goes away?
Comment #15
cato commentedI'm seeing something similar in the latest dev versions of Media and File Entity. I can insert images but when I try to insert a PDF file it fails with EntityMalformedException. It doesn't seem like the entity has been loaded because $form['options'] is almost empty. I've documented it a bit more in this issue: https://drupal.org/node/2262107
Comment #16
cato commentedRelated issue:
Comment #17
jmuzz commentedI don't think marcoka was saying that the error is because of this patch.
Comment #18
das-peter commentedAs far as I can see the bug originates in
media_wysiwyg_format_form().The function itself manipulates
$form_statebut the parameter isn't passed as reference but as copy. Thus the changes stay in the local scope and are lost / not available later in the further form handling / in the form alteration hooks.Because of that
media_wysiwyg_view_mode_form_alter()accesses an non existent array item and triggers all subsequent issues.Comment #19
cato commentedTried the patch in #18. Still getting the same error though.
Comment #20
PI_Ron commentedCan confirm patch from #18 works with latest media dev:
Comment #21
fonant commentedI can confirm that the patch in #18 works here for media-7.x-2.0-alpha3+80-dev too. Thanks!
Comment #22
cato commented@fonant @PI_Ron : have any of you tried to insert anything but images or video? I'm having the same issues with Document i.e. PDF files. The patch did not solve the issue for me.
Comment #23
das-peter commented@cato: if your issue just is related to Document i.e. PDF files, and this patch fixes images for you too, I guess it definitely deserves an own issue.
Comment #24
cato commented@das-peter FWIW now when I retest it on a clean download of latest media dev version its working. I think I might have applied another patch before testing #18 so I guess we're all ok now. Imma update the related issue too and point to #18 in this one.
Comment #25
devin carlson commentedThanks for the patch and the reviews!
I tested #18 with an existing Media install and didn't run into any issues.