Closed (fixed)
Project:
FileField
Version:
6.x-3.10
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2010 at 03:12 UTC
Updated:
10 Apr 2013 at 15:59 UTC
Jump to comment: Most recent file
Comments
Comment #1
duozerskI have the same error messages in the watchdog, not sure if I should try this patch.
I'm using Filefield + Imagefield (6.x-3.7 both) + Filefield Paths 6.x-1.4 (to arrange the files on the file system). The issue is that sometimes the images uploaded with Imagefiled widget and then inserted into FCKeditor using the Automatic style of the Insert module just disappear after saving the node edit form (both from the view node and the files uploaded in the node edit form).
It all worked just fine in the past (3-4 months ago)... but we are having difficulties to track after which update is became broken. As Filefield Paths didn't update for quite some time - then it leaves us with the updates of Filefield/Imagefield (maybe it requires some code changes to Filefield Paths module).
Any help would be appreciated.
Thanks
AndyB
Comment #2
duozerskWhile searching for a root cause of the issue I described above - looks like it might be unrelated to the watchdog error message, sorry for that.
I found another issue with the images disappearing #745768: Certain Imagefield Crop Files deleted after node save. Disabled the file name sanitization logic in the Filefield Paths for now.
I will raise another issue for my problem if needed - please consider it a separate one, not related to the initial one about the watchdog message.
AndyB
Comment #3
craig_ commentedwanted to bump this to the maintainers, to see if this patch is going to make the next release of filefield v3.x
in the code, an empty array is handled, but a null is not. this patch helps turn a null into an empty array, so the function can continue execution
thanks!
Comment #4
maciej.zgadzaj commentedI had the same error too, only that in my case $item was NULL ($file was a proper array), which was coming from $element not having any #default_value set.
And it happened only when no file was uploaded to a field (as actually I had 2 ImageFields and 1 FileField in the form - if all 3 of them were empty, I was getting 3 errors like this), after uploading at least one file error disappeared.
Attached patch did help in my case.
Comment #5
yesct commentedpatch in #3 made one of the errors (warnings) in #972044: Fully support multi-valued CCK fields go away. (editablefields)
Needs better comment 1) end with a period and 2) describe what the new code is doing, not just what was wrong before.
Comment #6
craig_ commentedlet me know if this is sufficient
Comment #7
Von Gunther commentedThis error also occurs when the files database table is missing an entry (accidental erasure etc ) refered to elsewhere.
Comment #8
quicksketchI've committed this simple patch which accomplishes the exact same thing but just reuses the existing conditional instead of adding a new one.
Suggested approach from above:
New approach:
Thanks for your patience on this guys. Now that I've gone through the queue and cleaned up all the issues that have been solved I'll put out a new release shortly.
Comment #9
quicksketchThe 3.10 version of FileField is now available for your downloading pleasure. Please do not reopen this issue. File a new issue against 3.10 for further problems.
Comment #11
tfmy2k commentedI had 6.x-3.9 installed: i was getting the Argument #2 is not an array in /sites/all/modules/filefield/filefield_widget.inc on line 255 directory.
I then upgraded to 6.x-3.10. I am now consistently getting the following error:
Argument #1 is not an array in /sites/all/modules/filefield/filefield_widget.inc on line 255.
I have verified that the files do end up getting uploaded into the following directory:
.../sites/default/files/
I have spent almost half a day on this: NO AVAIL: my site is down: Please help!!!
Comment #12
tfmy2k commentedIn addition to the above post: If i try to upload file from Drupal back-end, it gives me following error message:
Fatal error: Only variables can be passed by reference in drupal/includes/form.inc on line 1345
Comment #13
rgarand commentedI'm seeing this with filefield 3.10. It gives the following 2 errors:
# warning: array_merge() [function.array-merge]: Argument #2 is not an array in sites/all/modules/contrib/filefield/filefield.module on line 319.
# warning: array_merge() [function.array-merge]: Argument #1 is not an array in sites/all/modules/contrib/filefield/filefield_widget.inc on line 255.
In filefield_widget_value, $edit is set to false and $element['#default_value'] is null. This goes down a different branch and doesn't activate the original fix. The site has a few custom modules that I'm still not familiar with so I'm not sure if filefield causes this but it can handle it easily by using
instead of
in filefield_widget (filefield.module)
Comment #14
nitebreedThe fix in #13 seems to work fine!
Comment #15
scriptaimago commentedI've applied all the suggested patches, once at time. I still get the warning. Any idea?
Comment #16
quicksketchThe suggested change in #13 was made in #1171760: warning: array_merge() [function.array-merge]: Argument #2 is not an array when using CCK 3.x.