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!
Files: 
CommentFileSizeAuthor
#2 cck_multigroup_fielfield.patch1.3 KBandyhu

Comments

Hi,
got same errors, make similar you made, seems works ok for now.

StatusFileSize
new1.3 KB

Hi,

I also experienced this issue with two filefields in a field group. I've made a patch to fix this. Please test.

Thanks!

Thanks!

Status:Active» Reviewed & tested by the community

I have testede this and it works.

Title:Need help with this warning.Need help with this warning: array_keys() expects parameter 1 to be array, null given in content_multigroup.node_form.inc

The patch works for me, too.

The patch is ok for me too, thx.

subscribe, patch works

subscribe, patch works

Ok. I subscribe, the patch it work for my.

patch works, thx!

Status:Reviewed & tested by the community» Closed (duplicate)

This 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.

Thanks dude! The Patch works for me, too.

Thanks guys! I updated my module to 6.x-3.x-dev as explained in #11. This worked for me.