Hi,
I got this warning message when I try to edit.
warning: array_keys() expects parameter 1 to be array, null given in C:\git\csc_d6\sites\all\modules\cck\modules\content_multigroup\content_multigroup.node_form.inc on line 315.
warning: array_keys() expects parameter 1 to be array, null given in C:\git\csc_d6\sites\all\modules\cck\modules\content_multigroup\content_multigroup.node_form.inc on line 281.
When I look at line 281 and 315 it does not check to see if $form['#multigroups_required_fields'] has any values.
To get rid of the warning I add some checking like this.
if(!empty($form['#multigroup_required_fields'])){
$required_fields = array_keys($form['#multigroup_required_fields'][$group_name]);
if (!empty($required_fields)) {
content_multigroup_node_form_fix_required($form[$group_name], $required_fields, TRUE);
}
}
I don't know if doing that could cause any issues. Please let me know if you have any insight to this. Thanks!
Comment | File | Size | Author |
---|---|---|---|
#2 | cck_multigroup_fielfield.patch | 1.3 KB | andyhu |
Comments
Comment #1
Ujin CreditAttribution: Ujin commentedHi,
got same errors, make similar you made, seems works ok for now.
Comment #2
andyhu CreditAttribution: andyhu commentedHi,
I also experienced this issue with two filefields in a field group. I've made a patch to fix this. Please test.
Thanks!
Comment #3
vtsan CreditAttribution: vtsan commentedThanks!
Comment #4
yingtho CreditAttribution: yingtho commentedI have testede this and it works.
Comment #5
capellicThe patch works for me, too.
Comment #6
sebasto CreditAttribution: sebasto commentedThe patch is ok for me too, thx.
Comment #7
mikeytown2 CreditAttribution: mikeytown2 commentedsubscribe, patch works
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedsubscribe, patch works
Comment #9
isaac.el.cec@gmail.com CreditAttribution: isaac.el.cec@gmail.com commentedOk. I subscribe, the patch it work for my.
Comment #10
nizer CreditAttribution: nizer commentedpatch works, thx!
Comment #11
roball CreditAttribution: roball commentedThis is a duplicate of #1097548: Warning on node edit form for multigroup without any required fields. Fix has already been committed and is included in the latest 6.x-3.x-dev (2011-Aug-02), thus no need to manually patch.
Comment #12
Lucience CreditAttribution: Lucience commentedThanks dude! The Patch works for me, too.
Comment #13
nickgs CreditAttribution: nickgs commentedThanks guys! I updated my module to 6.x-3.x-dev as explained in #11. This worked for me.