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 Drupal 6.10 with CCK 6.x-2.1. When I installed Emfield and turned on Embedded Media Field everything was fine, I then turned on Embedded Video Field and got:
* warning: array_merge(): Argument #2 is not an array in /srv/www/htdocs/sites/all/modules/cck/content.install on line 43.
* warning: array_merge(): Argument #2 is not an array in /srv/www/htdocs/sites/all/modules/cck/content.install on line 43.
Any thoughts? Thanks.
Comment | File | Size | Author |
---|---|---|---|
#78 | 398400-78.patch | 757 bytes | dale42 |
#56 | 398400-49.patch | 701 bytes | antiorario |
#14 | array_error-398400-14.patch | 621 bytes | soulston |
Comments
Comment #1
Alex UA CreditAttribution: Alex UA commentedThis has been fixed for a long time.
Comment #2
anrikun CreditAttribution: anrikun commentedI'm opening this again as I just got these errors too on installing emfield 6.x-2.4.
Using Apache2 + PHP 4.3 on Windows XP.
Comment #3
anruetherI got this when I added a video field to a content type:
warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../sites/all/modules/emfield/emfield.cck.inc on line 163.
warning: array_merge() [function.array-merge]: Argument #1 is not an array in .../sites/all/modules/emfield/emfield.cck.inc on line 163.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../sites/all/modules/emfield/contrib/emvideo/emvideo.module on line 584.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../sites/all/modules/emfield/emfield.cck.inc on line 163.
warning: array_merge() [function.array-merge]: Argument #1 is not an array in .../sites/all/modules/emfield/emfield.cck.inc on line 163.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../sites/all/modules/emfield/contrib/emvideo/emvideo.module on line 584.
using drupal 6.20, cck 2.9 and todays' dev of Embedded Media Field
Comment #4
John Carbone CreditAttribution: John Carbone commentedI have emfield installed and got this error after upgrading emfield and cck, then upgrading the link module and running update.php
Comment #5
rothatboat CreditAttribution: rothatboat commentedSubscribing
Comment #6
altbzh CreditAttribution: altbzh commentedJ have the same warning : video works but not for audio.
I have Drupal 6x.20. My setting for PHP is PHP 5.3.
Thank you.
Comment #7
davidpauljunior CreditAttribution: davidpauljunior commentedSame error here.
Probably related to this, it won't save any changes when I go to configure the field (under manage fields).
Wanted to change default size, but it just reverts it back when you save.
Comment #8
Tafa CreditAttribution: Tafa commentedi am in a similar situation as well as i have just updated the module onto my test website...
Any help would be more than appreciated...
Thanks
T
Comment #9
tescometro CreditAttribution: tescometro commentedVery much the same thing happening for me. again trying to configure the field results in default size input not being saved or applied.
Occurs with the same errors as above.
Comment #10
unc0nnected CreditAttribution: unc0nnected commentedI can also confirm this with Drupal 6.2 and the 6.x.25 of Embedded Video. It works, the new field holds however none of the settings configured for that field are saved
Exact same error messages as above
Comment #11
Tafa CreditAttribution: Tafa commentedokay, i hope i got it right. basically, i change line 163 to the following:
$columns = array_merge($columns, array(module_invoke($module, 'emfield_widget_settings_extra', 'save', $widget)));
i then went on to change some of the settings on my content type where the embedded image field resided and saved. after saving, i got another error message along the lines of warning: Illegal offset type in isset or empty in ...
saved again and error went away...
hope that helps,
t
Comment #12
anrikun CreditAttribution: anrikun commented@Tafa: a patch please :-)
Comment #13
Tafa CreditAttribution: Tafa commentedi'd rather leave the patch work to someone more experienced as:
a- i know little about patches, even though i am looking into it at the minute
b- i am unsure my fix does actually work given the existence of the warning it fires afterwards....
if you want to implement the change as i did, all that is required is for you to find the inc file which lione 163 is part of and change as mentioned above
hope that helps,
t
Comment #14
soulston CreditAttribution: soulston commentedWell here is a patch that resolves the array errors, but as Tafa points out a new error occurs for me in cck:
Illegal offset type in isset or empty in /sites/all/modules/contrib/cck/includes/content.crud.inc on line 444.
Comment #15
knigh7 CreditAttribution: knigh7 commentedsub
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedSubscribing. Same error :(
Comment #17
iaminawe CreditAttribution: iaminawe commentedsubscribing - same error
Comment #18
damiandab CreditAttribution: damiandab commentedsubcribing - same problem :(
Comment #19
jrabeemer CreditAttribution: jrabeemer commentedI get the same error. Bumping priority. This is a major bug in the 6.x-2.5 release.
Comment #20
green monkey CreditAttribution: green monkey commentedsubcribing - same problem :(
Comment #21
itzcoatl CreditAttribution: itzcoatl commentedsubscribing
Comment #22
green monkey CreditAttribution: green monkey commentedUpdate:
Perhaps this nothing to do with issue.
But I first saw this when I changed the thumbnail size to 200x150
Comment #23
ayalon CreditAttribution: ayalon commentedThe error occurs, If you activate the Video Module without a Video Provider.
Solution:
Delete Any Video Fields on your Content Types
Deactivate all Modules of emfield
Uninstall all modules from emfield
Download Media Youtube Provider Module
Activate Media Youtube Module
Recreate your fcck video field: No more errors!
Comment #24
green monkey CreditAttribution: green monkey commentedFatal error: Call to undefined function emfield_provider_menus() in /home/website.com/sites/all/modules/emfield/contrib/emvideo/emvideo.module on line 22
during uninstall
Comment #25
green monkey CreditAttribution: green monkey commentedupdate
seem to uninstall better - if I only uninstall the Video and YouTube and leave everything else install
Comment #26
jydrupal CreditAttribution: jydrupal commentedgetting same error:
array_merge() [function.array-merge]: Argument #2 is not an array in /home/content/17/6841317/html/modules/emfield/emfield.cck.inc on line 163.
what to do? please suggest
Comment #27
Vc Developer CreditAttribution: Vc Developer commentedsubscribing!...
Comment #28
tivie CreditAttribution: tivie commentedsame issue.
warning: array_merge(): Argument #2 is not an array in /home/user/site/dev/sites/all/modules/emfield/emfield.cck.inc on line 163.
warning: array_merge(): Argument #1 is not an array in /home/user/site/dev/sites/all/modules/emfield/emfield.cck.inc on line 163.
warning: array_merge(): Argument #1 is not an array in /home/user/site/dev/sites/all/modules/emfield/emfield.cck.inc on line 163.
warning: array_merge(): Argument #2 is not an array in /home/user/site/dev/sites/all/modules/emfield/contrib/emvideo/emvideo.module on line 584.
followed the steps of uninstalling and installing and still, same issue.
Comment #29
iaminawe CreditAttribution: iaminawe commentedSame here - uninstalled, reinstalled - recreated fields on content types , still same error
Comment #30
leewebdev CreditAttribution: leewebdev commentedNothing helpful to add, but I do want to report I'm experiencing the same error as displayed in #28. Will keep checking back here for a solution. Thanks.
Comment #31
thomasgm CreditAttribution: thomasgm commentedHello, i've fixed this changed the line on file emfield.cck.inc
Line 163:
$columns = array_merge($columns, module_invoke($module, 'emfield_widget_settings_extra', 'save', $widget));
with this one:
$columns1 = array_merge($columns, array(module_invoke($module1, 'emfield_widget_settings_extra', 'save', $widget)))
Hope it helps someone.
Comment #32
thomasgm CreditAttribution: thomasgm commentedThe only problem is that if check the box "Required" on cck, even if you fill right the video infos it still says "Name of video field is required"
Comment #33
krisrobinson CreditAttribution: krisrobinson commentedSubscribing
Solution in #31 provides a new error:
warning: Illegal offset type in isset or empty in /sites/all/modules/cck/includes/content.crud.inc on line 444.
Comment #34
jydrupal CreditAttribution: jydrupal commentedDid exactly what # 31 did and it fixed the problem but got the error that #33 has. I got error mentioned in # 33 while saving changes but it goes away if you save it AGAIN after going in and coming out of the form. Try if it works for you!
Comment #35
temelkoff CreditAttribution: temelkoff commentedsubcribing
Illegal offset type in isset or empty in /sites/all/modules/cck/includes/content.crud.inc on line 444.
Comment #36
nelsonbranco CreditAttribution: nelsonbranco commentedGot the same problem as #3, any solutions yet?
Comment #37
anrikun CreditAttribution: anrikun commented@unc0nnected: are you working on a patch to fix this bug?
Comment #38
damiandab CreditAttribution: damiandab commentedthe same problems as #3
Comment #39
hihappycats CreditAttribution: hihappycats commentedme too.
Comment #40
damiandab CreditAttribution: damiandab commentedit's not possible to use this version of module. I can not even change/save configuration (example: width height of the player) in cck field settings :(
Comment #41
anrikun CreditAttribution: anrikun commented@unc0nnected: if you are not working on a patch to fix this bug, don't assign this issue to you.
Comment #42
vaudaville CreditAttribution: vaudaville commentedReporting the same setup and problem as #3
Comment #43
narongwit12 CreditAttribution: narongwit12 commentedsubscribing
Comment #44
SchwebDesign CreditAttribution: SchwebDesign commentedYikes, i'm getting this error too using 6.x-2.5. I also have PHP 5.3.6. Is that perhaps the issue? Subscribing.
Comment #45
SchwebDesign CreditAttribution: SchwebDesign commentedspecifically, after attempting to add embedded video CCK field to a content type i get this:
and then this after attempting to save the following page:
and then it says "Added field Video."
i'll have to see if it still works somehow...
Comment #46
iamjon CreditAttribution: iamjon commentedI'm getting the same error. Experienced after having embeded video field, with youtube, afterwards wanted to add vimeo.
On uninstall I get this error:
Fatal error: Call to undefined function emfield_provider_menus() in /www/drupal6/sites/all/modules/emfield/contrib/emvideo/emvideo.module on line 22
Like #24...is it possible that not all the errors here are related?
Using the latest version of the module for 6.x not dev.
If anyone needs a quick workaround to uninstall, after uninstalling all the modules on line 34 of emvideo.module add
Then you can uninstall....but don't forget to get rid of it right after you uninstall cause it's a terrible quick and dirty hack.
Comment #47
heli0s CreditAttribution: heli0s commentedToday, I just installed the very latest stable release of Drupal 6, and this module. I started getting this error as well when I tried to create a content type; I only had one media type installed (youtube). So maintainers please listen up, this bug is NOT FIXED as someone earlier mentioned.
Looking at the code, I made a slight correction to get rid of the error. I also tried creating CCK content and didn't seem to have any issues as some others mentioned. Disclaimer: I didn't spend much time looking over the code (probably all of 5 minutes), so if this does not fix the underlying problem don't blame me.
My thought was perhaps the function module_invoke was not returning an array unless it had multiple items to return (ie. using just one or no media types). So, here is what I did if anyone is interested. :)
Starting around line 162, change the foreach block like so:
Change this:
To this:
Comment #48
demonrage CreditAttribution: demonrage commented#47 solution doesn't fix anything from my side. this is a serious problem, i even tried the latest dev version, updated, same error
Comment #49
Anonymous (not verified) CreditAttribution: Anonymous commentedI changed the following after which the save actions seemed to work:
line 160 in emfield.cck.inc
Original code:
Modified code:
I no longer see the warnings and providers are saved as expected.
Comment #50
sjohnson CreditAttribution: sjohnson commented@Qubical - I registered just to thank you for this fix. A wonderfully timely and seemingly effective solution. No errors and my settings saved. Thanks!!!
Comment #51
aegagros CreditAttribution: aegagros commented@Qubical - thanks for the fix. Same errors here on save and update, and no settings saved for video width and height. Fixed with #49.
Comment #52
demonrage CreditAttribution: demonrage commentedReally thanks dude,
Now my website can see the light again :)
Comment #53
peterbrunton CreditAttribution: peterbrunton commentedCode from post #49 also worked for me. Thanks Qubical
Comment #54
extensive CreditAttribution: extensive commentedPost #49
Work for me!
Many many Thanks!
Comment #55
anrikun CreditAttribution: anrikun commented@Qubical: please turn this into a patch. Thanks!
Comment #56
antiorario CreditAttribution: antiorario commentedSince no one is providing a patch, here it is. It's the solution at #49, so credit goes to Qubical.
Comment #57
ilgriso CreditAttribution: ilgriso commentedSolution at post #49 works also for me!
Thanks a lot!
Comment #58
ifrikApplying the patch failed, but solution #49 works for me.
Comment #59
SchwebDesign CreditAttribution: SchwebDesign commentedPatch from #56 worked for me as well http://drupal.org/node/398400#comment-4689226 I believe this is nearly identical to #49
Comment #60
galactus CreditAttribution: galactus commented#49 worked like a charm! Thanks Qubical! I was using the latest version Embed 2.5
Comment #61
tescometro CreditAttribution: tescometro commentedThanks Qubical, your code @#49 fixed it for me too.
Comment #62
Macronomicus CreditAttribution: Macronomicus commented#49 worked perfectly.
Cheers Qubical!
Comment #63
wmfinck CreditAttribution: wmfinck commentedStrange, I installed emfield on "Site A" last week, and did NOT have this problem. Now today I install it on "Site B" and I DO have this problem. Both sites are on the same server, and the only difference is that "Site A" has MORE modules installed (OG) than "Site B" while all else is equal.
Then I remembered that on "Site A" I installed emfield LAST - after the CCK, Views, SWFTools and the other modules I install just about everywhere as standard for me. On "Site B" I installed emfield BEFORE Views & SWFTools (NOT before the CCK).
So before resorting to the patch above, I uninstalled all emfield modules, and reinstalled them (it is a new site with no data to worry about) and behold, the problems were gone, and no patch is necessary!
Of course, I am not knocking the patch - you will need it if you have data on your site that you do not want to lose. But perhaps the developers could see the problem a little clearer now, I hope.
Comment #64
BeaPower CreditAttribution: BeaPower commented#49 works for me!
Comment #65
Sk8erPeter CreditAttribution: Sk8erPeter commented@Qubical in #49:
I think that's absolutely NOT correct! If it isn't an array, you just simply give back an EMPTY array?? Please tell me what sense it makes...
I think the correct solution is the following:
This way I cast
$module_invoke
variable to an array.Comment #66
Anonymous (not verified) CreditAttribution: Anonymous commentedIf it suits your needs that is fine and indeed it looks like a better way to handle it.
No need to "WTF" though, just your reply informing ppl of a better solution will be quite enough.
Comment #67
Sk8erPeter CreditAttribution: Sk8erPeter commentedOK, I edited my reply, but I didn't understand why people deify a really disputable solution. :)
Comment #68
tescometro CreditAttribution: tescometro commentedDeify? Are you just trolling? I'm sure people have simply expressed due gratitude for a working fix. And Qubical's solution is not disputable, it works completely without any known problem.
I for one have been very appreciative of Qubical's fix. It works both in terms of fixing the error, and allowing settings to be saved. Many others here have also been grateful for Q's fix, for me it was also particularly timely, allowing me to commit to using this module at a critical time in a project. I have, to date, had no known issues using it.
Your proposed "correct" solution (in reality of course there can be no single "correct" solution, though a better/different one is always possible of course.. ) is some 8 weeks later, and is as yet seemingly unconfirmed/untested in the field. You seem to have useful coding skills and vision, but no sense of tact or appreciation of others efforts. Everyone has different levels of skill or skill-base here. I appreciate you have removed the WTF, but now you choose to try insult the rest of us for our "deification" of his efforts? Displaying this amount of irritation at the praise Qubical has rightly received really isn't in the spirit of the Drupal community and I think you'll make yourself pretty unpopular in the long run with your approach. This would be a shame, as your contributions look like they could be very useful. Most modules and patches are provided completely free and with good grace here. Sure, many things are far from perfect, but there is generally a good vibe, and recognition of the time people have often spent helping others.
Out of interest, and quite seriously, as I'm still running with Qubical's fix, could anyone explain the potential consequences of its "incorrectness"?
Comment #69
SchwebDesign CreditAttribution: SchwebDesign commentedwell said. I'll second that question.
Comment #70
Anonymous (not verified) CreditAttribution: Anonymous commentedThank you very much tescometro and SchwebDesign for your support of the spirit of the community.
Indeed tact is lacking slightly from his reply in my opinion but technically he is correct.
I can understand sk8terpeters' solution as this means that if the module returns a string or other data not being an array he converts it to an array and passes the value to the rest of the script.
My solution only fixes the missing array by placing an empty array into the script if the function call is not returning an array.
His solution indeed should be the better option as it keeps the data, if any was passed down by the function call. Otherwise it returns an empty array. I must admit I have not yet changed it myself as the project I was burning midnight oil for works as expected.
Comment #71
nnotario CreditAttribution: nnotario commented#49 works for me also!
Comment #72
zeropx CreditAttribution: zeropx commentedThanks Qubical,
This solution proved to work perfect.
Comment #73
muddie CreditAttribution: muddie commentedThanks from me too Qubical.
Saved my bacon.
Comment #74
fuzzyjared CreditAttribution: fuzzyjared commentedI can confirm this is happening.
drupal 6.22
emfield 6.25
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /sites/all/modules/contrib/emfield/emfield.cck.inc on line 163.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /sites/all/modules/contrib/emfield/contrib/emvideo/emvideo.module on line 584.
error triggered when adding cck field to content type.
After applying the patch / patch edit all appears to be working.
$module_invoke = module_invoke($module, 'emfield_widget_settings_extra', 'save', $widget);
if( !is_array($module_invoke) ) $module_invoke = (array)$module_invoke;
$columns = array_merge($columns, $module_invoke);
Comment #75
jerry CreditAttribution: jerry commentedThe patch in comment #49 with the modification in #65 worked for me as well.
Comment #76
dkingofpa CreditAttribution: dkingofpa commented@Sk8erPeter, please provide a patch with your proposed solution. Thanks. How to create a patch: http://drupal.org/node/707484
Comment #77
brycesenz CreditAttribution: brycesenz commentedsubscribing, and confirming that the patch in #65 works for me.
Additionally, I'm setting this issue to "reviewed and tested by the community", as this solution seems to be solving the issue for several of us.
Comment #78
dale42Here is the patch in #49 updated per solution in #65.
Experiencing the errors with 6.x-2.5/Drupal 6.22. Apply the patch resolves them.
Comment #79
Sk8erPeter CreditAttribution: Sk8erPeter commented@tescometro, #68 : I just saw your answer a "little bit" later. :) But I have to react just to clarify a few things, because I felt your answer unjust. OK, I admit that the word "deifying" could be a little bit insulting for someone so sensitive that it hurts his feelings :P, sorry - I didn't want to insult anyone.
But I wanted to clarify Qubical's fix is absolutely not so perfect, because it CAN cause unexpected errors IF
module_invoke()
function returns some kind of values that has to be saved and used later. That's why I checked if it's an array - if it's not, than it has to be casted not to get a warning message when using thearray_merge()
function. Qubical's solution simply ignores the return value if it's not an array. The code in his solution just checks its type, if it's an array, it saves its value, if not, it just simply creates an empty array. Maybe it doesn't cause any problems at all, because maybe in most cases this value isn't used in the module's given part later, but it's not excluded that this value could be useful in some cases. I hope you understand the "incorrectness" of the firstly provided patch.I don't think I was so rude when posting my own patch that I could be excluded from Drupal community as you forecasted :D:D, and I didn't start using forums today, so I don't need a preaching like "dah dah, you were bad, shame on you, stand in the corner, you bastard", but thanks for calling my attention to take care of myself. :D And believe me, I wasn't "irritated" of Qubical's "praise", but possible mistakes that spread in Drupal community and can cause possible warnings or errors do annoy me, and I feel like I have to correct them if I know a possibly better solution, which maybe still isn't perfect - you can judge me for that. :) But you're right, we have to be more friendly to each other - this also applies to you! :P I hope everything is OK now, so peace!
@Qubical, #70 : thanks! :)
@dale42, #78 : thank you very much for making the patch, hope this will work without warnings.
Pete
Comment #80
tescometro CreditAttribution: tescometro commented@Sk8erPeter I'm not going to argue the P's and Q's of bits of this. Instead will just say it nice you've replied this way. I agree with much you say, and applaud you for moving forward and commenting back here. Nice one. Thanks for leading to a better patch, and Peace!
Comment #81
sirian CreditAttribution: sirian commentedThanks Qubical for your path that saved me time.
Comment #82
amanda CreditAttribution: amanda commentedSigh.
We're having the same problem -- the module sets up fine but if we try to change any settings (the preview size, in particular) we get this array_merge() error and the change isn't saved.
Comment #83
duntuk CreditAttribution: duntuk commented#49 works.
Comment #84
aaron CreditAttribution: aaron commentedThanks so much for the work on this issue. I tried installing the module with YouTube only, but I wasn't able to reproduce the error. However, with so many people reporting the error, and considering the code seemed innocuous enough, I have committed the fix. Note that I modified the patch slightly, simply typecasting the value as an array, saving us an extra couple of lines. Commit is at http://drupalcode.org/project/emfield.git/commitdiff/17bd36e?hp=f71633ba...
Comment #86
purna_dey CreditAttribution: purna_dey commented#49 works.
Comment #87
_sparrow_ CreditAttribution: _sparrow_ commentedI'm sorry, the issue is not fixed yet. I downloaded and installed the module an hour ago and as well got this warning. I applied the fix from #49 and all went alright.
I'm using 6.x-2.5.
Comment #88
zisser CreditAttribution: zisser commentedThanks!
That #23 worked for me.
Comment #89
zisser CreditAttribution: zisser commentedThanks!
Did the trick
Comment #90
the_g_bomb CreditAttribution: the_g_bomb commentedI can confirm that this is indeed fixed, the code is in 6.x-2.6.