I have the CCK version 6.x-3.x-dev with version 6.x-3.1 installed, and mostly the module works fine.
However, if I have an imagefield with the "Unlimited" option enabled there is a problem.
When editing the node and adding the first image (i.e. the first time the "Add another item" button is clicked), I get the following errors: -
* warning: Invalid argument supplied for foreach() in /sites/all/modules/cck/includes/content.node_form.inc on line 456.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /sites/all/modules/cck/includes/content.node_form.inc on line 464.
* warning: Wrong parameter count for max() in /sites/all/modules/cck/includes/content.node_form.inc on line 464.
At first, I thought this was a CCK issue (it could be) but testing with other CCK fields (e.g. text, number etc.) seems to be OK.
The rest of the process works fine - I can upload an image and it is displayed. Clicking "Add another item" again also works fine once the first field is there.
Thanks,
Dubs
Comment | File | Size | Author |
---|---|---|---|
#1 | fix.png | 10.43 KB | beetbe.com |
Comments
Comment #1
beetbe.com CreditAttribution: beetbe.com commentedI have the same problem with my website. The problem comes from Ubercart Image upload field and CCK
* warning: Invalid argument supplied for foreach() in C:\Program Files\Apache Group\Apache2\htdocs\fakoon2\modules\cck\includes\content.node_form.inc on line 456.
* warning: array_keys() [function.array-keys]: The first argument should be an array in C:\Program Files\Apache Group\Apache2\htdocs\fakoon2\modules\cck\includes\content.node_form.inc on line 464.
* warning: Wrong parameter count for max() in C:\Program Files\Apache Group\Apache2\htdocs\fakoon2\modules\cck\includes\content.node_form.inc on line 464.
How to solve this ?
Comment #2
benthomas1975 CreditAttribution: benthomas1975 commentedI too am getting this same error message, searched through Ubercart and Drupal and this is the only mention of it, I assume it is a new problem?? HELP!
Comment #3
Roman V.D. CreditAttribution: Roman V.D. commentedThe same problem! HELP!
Comment #4
edemus CreditAttribution: edemus commentedHi,
You guys should check #515622: FileField and CCK 3-dev result in no fields displayed by default
It worked for me.
Comment #5
Roman V.D. CreditAttribution: Roman V.D. commentedWe need any developers comments! Help please!
Comment #6
beetbe.com CreditAttribution: beetbe.com commentedNo one here! A lot of issues still has no question. I am really tired with a lot of potential dangers are coming with other drupal's modules
Comment #7
Roman V.D. CreditAttribution: Roman V.D. commentedUP!
Comment #8
lowVocal CreditAttribution: lowVocal commentedSAME:
CCK 6.x-3.x-dev (2009-Aug-29)
ImageField 6.x-3.1
Initially no field is present -- just submit button.
Then when submitted (to see what it forces to happen) I get this:
* warning: Invalid argument supplied for foreach() in /var/www/dev6.site.org/sites/all/modules/contrib/cck/includes/content.node_form.inc on line 456.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/dev6.site.org/sites/all/modules/contrib/cck/includes/content.node_form.inc on line 464.
* warning: Wrong parameter count for max() in /var/www/dev6.site.org/sites/all/modules/contrib/cck/includes/content.node_form.inc on line 464.
Thanks.
Comment #9
techgu CreditAttribution: techgu commentedI have the same issue.
When I try to create a product the button below Image says "Add another item" when you click the button it brings up this error message:
* warning: Invalid argument supplied for foreach() in /modules/cck/includes/content.node_form.inc on line 456.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /modules/cck/includes/content.node_form.inc on line 464.
* warning: Wrong parameter count for max() in //modules/cck/includes/content.node_form.inc on line 464.
However if you go to edit an item you can add a picture no problem.
Comment #10
lowVocal CreditAttribution: lowVocal commentedNot conclusive, and not a fix.
I altered the widget type from "image" to image FUpload after installing the FUpload module (for a different unrelated purpose.)
The field shows now and works — ...?
There is a bug, or perhaps an image upload/imagefield conflict — I'm guessing...
Comment #11
ThePiano.SG CreditAttribution: ThePiano.SG commentedsubscribe
Comment #12
.............................................. CreditAttribution: .............................................. commented+
Comment #13
Patsjoelie CreditAttribution: Patsjoelie commentedSame problem, no solution.
Subscribing
Comment #14
dungiis CreditAttribution: dungiis commentedlot of problems are the same
Comment #15
twooten CreditAttribution: twooten commentedI have the same issue. I do not have Ubercart or FUpload installed so it's not coming from either of those modules.
This is a Drupal 6.14 install fully updated.
I get the following.
* warning: Invalid argument supplied for foreach() in /home/wwd/public_html/sites/all/modules/cck/includes/content.node_form.inc on line 456.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/wwd/public_html/sites/all/modules/cck/includes/content.node_form.inc on line 464.
* warning: Wrong parameter count for max() in /home/wwd/public_html/sites/all/modules/cck/includes/content.node_form.inc on line 464.
Tim
Comment #16
kruser CreditAttribution: kruser commentedsubscribing
Comment #17
robino CreditAttribution: robino commentedHi, I suddenly had the same problem and then figured it was because I had upgraded my cck to version to 6.x-2.x-dev. I just went back to 6.x-2.5 and there is no bug.
Comment #18
amcc CreditAttribution: amcc commentedI have the same problem, I think its worth outlining the issues/causes
As this issue is clearly related to CCK 3 it could be a problem with that not imagefield - any thoughts
Comment #19
markus_petrux CreditAttribution: markus_petrux commentedLet me transfer this issue to the CCK queue. I've been able to track the problem. It is caused by the following code in FileField module:
But that's not incorrect. The issue is that $form_state['item_count'] in CCK3 does not work like in CCK2. A quick workaround would be:
1) Edit cck/includes/content.node_form.inc
2) Apply this mini-patch:
Comment #20
amcc CreditAttribution: amcc commentedworks like a charm, many thanks for such a quick response. I was slightly disheartened when i saw that this issue was originally posted in August (shows how choosing your queue helps here).
Its probably worth pointing out to anyone applying this patch manually that its line 161 that needs changing
Comment #21
markus_petrux CreditAttribution: markus_petrux commentedOk, I'm also pretty sure the above mentioned patch fixes the issue. Committed to CVS. ;-)
http://drupal.org/cvs?commit=271078
Comment #22
aries CreditAttribution: aries commentedSorry guys, but still not solved.
Comment #24
hendrinx CreditAttribution: hendrinx commentedFYI - the latest 6.x-3.2 FileField release addresses this problem - works like a charm now
Comment #25
ccshannon CreditAttribution: ccshannon commentedI'm having this problem using the latest (Dec. 7, 2009) build of CCK 3, using either Filefield 3.0 or 3.2, same issue.
Using Multigroup, I can add new items to the group, but my Imagefield fields (set to Unlimited) I have the 'Add Another Item' button, but cannot actually add anything. Clicking the button I get the throbber thingie, but no additional upload widgets into the field. This is not a problem with any other field or widget. Regular Filefield widget works fine, only affects image widget.
EDIT - Oops, didn't read the full thread title. I think I need to open a new CCK issue, as it's not a JS error.
EDIT 2 - Okay, turned out my problem was using "Imagefield Zip Extract". Disabling that module got my Image widgets working again.