Closed (duplicate)
Project:
FileField
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2011 at 20:23 UTC
Updated:
12 May 2014 at 22:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xjmI have a similar error in 6.x-3.10 with FileField and FileField Meta enabled. The error appears on a view that includes links to documents, but only with a certain argument.
Comment #2
bomarmonk commentedI managed to get rid of my error only after deleting all filefield content through Drupal's content editing. I had to basically rebuild all content that included a filefield :(
Comment #3
xjmThat's not an option for me, as I have thousands upon thousands of nodes with filefield content. Surely there's an easier way to fix this error message? It could be as simple as
if is_array($foo){ }, or maybe detecting and correcting whatever missing array data before it gets to that point.Comment #4
bomarmonk commentedSomewhere I saw a post suggesting to set reporting from php or apache to be less strict; thus hiding these warning reports. If everything is working, maybe that's a solution. I didn't like it though; I wanted to get rid of the bad data, or whatever.
Comment #5
gandhiano commentedSame problem here, subscribing. I think it is related to what is said here: http://drupal.org/node/791118#comment-3949114 - something wrong with a late activation of FileField Meta. In my case, this happened as a consequence of an upgrade of an old drupal 5 website
Comment #6
labopen.ti commentedadding (array) at line 309 should solve the problem
// Load the complete file if a filepath is not available.
if (!empty($item['fid']) && empty($item['filepath'])) {
$file = (array) field_file_load($item['fid']);
if (isset($file['data'])) {
$file['data'] = array_merge($file['data'], (array) $items[$delta]['data']);
}
$items[$delta] = array_merge($file, $items[$delta]);
}
Comment #7
ayesh commented#6 worked!
Thank you.
Comment #8
xjmRe: #6. Cool! You should make a patch so the maintainer can review it. :)
Comment #9
drupalnesia commentedComment #10
guvser commentedPlease delete this post.
Comment #11
ShadowCaster commentedI encountered this problem as well. The change above in #6 solved the problem for me too. I'm running filefield 6.x-3.10.
Mike S
Comment #12
mikeytown2 commentedHere is a patch that fixes this error
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in filefield_widget() (line 319 of filefield/filefield.module).
Comment #13
maggie_au commentedThanks for Comment #6, it works~~~
Comment #14
quicksketch@mikeytown2: A patch that solves the problem your patch fixes has been committed separately in #1171760: warning: array_merge() [function.array-merge]: Argument #2 is not an array when using CCK 3.x. Not sure if that's actually related to the FileField Meta issue others are describing here though.
Comment #15
quicksketchHm, the lines described in #6 no longer exist, they're replaced with the ones we fixed in that other issue, so seems like this has been fixed and this is a duplicate.
Comment #16
loparr commentedOk, I am experiencing same issue as #1. Same problem is on line 61. I have last version installed.