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 am using Embedded Media to have a CCK video field for a specific content type. I added Media - Youtube as a provider as well.
The video plays fine but making any changes to the content type's video field I set up do not change when I save the settings on the content type / edit field page. I am wondering what I have done wrong? Thanks.
Comment | File | Size | Author |
---|---|---|---|
#7 | media-bonus-pack-interrupts-cck-field-settings-1268122-7.patch | 2.4 KB | kirikintha |
2011-09-02_12-26-31.png | 147.07 KB | Danny Englander |
Comments
Comment #1
phantomvish CreditAttribution: phantomvish commentedSame issue here. subscribing. Is there any workaround till we get a fix? I'm no programmer but, can we add say "vimeo" as a provider to the particular CCK field in the back end by phpmyadmin or something?
Comment #2
phantomvish CreditAttribution: phantomvish commentedComment #3
phantomvish CreditAttribution: phantomvish commentedI found the issue is with the "Embedded Media Bonus Pack". I disabled it and tried adding the provider to the field. It worked !
Comment #4
Danny Englander@phantomvish--Indeed, it looks like the issue is with Media Bonus Pack. I disabled that and then i was able to save custom settings to my Embedded Media field. Offhand I don't remember what Bonus Pack does, I need to look into that to see if it's something I really needed.
Comment #5
Danny EnglanderChanging title to be more meaningful and descriptive.
Comment #6
Danny EnglanderComment #7
kirikintha CreditAttribution: kirikintha commentedHi everyone,
I ran into this problem as well with the bonus pack, and it led me to look into this issue a little more in depth.
When adding a field, I was receiving a variety of warnings:
Debugging a little, I found that in embonus.module in the function embonus_emfield_widget_settings_extra($op, $widget) - there is a conditional for the $collect variable. If there are no modules implementing $collect, then the 'save' op is not producing a value at all, and is failing the array_merge.
I changed the way that embonus_emfield_widget_settings_extra($op, $widget) uses the switch, so that an empty array is populated if the $collect variable has not been set. This solves the above problem, without messing with how the static variable is working.
Updated code:
However, I thought about it for a minute here, and I realized that this solves the immediate problem, but one can still fail the function _emfield_emfield_widget_settings($op, $widget, $module) if a valid array is not sent back to function. Array merge summarily fails when no array is allowed to merge, effectively halting the 'save' op.
My solution is to also apply this code change to switch($op) in function _emfield_emfield_widget_settings on emfield.cck.inc:
So, if any module implements do not return an array properly, the array merge is still safe and will not bail out when saving. I have tested these patches, and find that I have regained the functionality I need and also that the bonus module does not fail when updating, AND that this should protect any other modules from bailing out the CCK fields saving properly when implementing emfield_widget_settings_extra if they are not so ready for prime time.
I have also included a patch file, from git - I am confident that the patching works, not necessarily that my patch file is perfect. I'll be watching this thread to see feedback here. Thank you for developing such a great module!
Comment #8
kclarkson CreditAttribution: kclarkson commentedI can download the patch to see if it works for me but someone else should review the actual code.
Comment #9
AnybodyAnything new about it?
The bug still exists for me so nothing seems to have changed so far?