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!

CommentFileSizeAuthor
#2 cck_multigroup_fielfield.patch1.3 KBandyhu
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

Ujin’s picture

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

andyhu’s picture

Hi,

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

Thanks!

vtsan’s picture

Thanks!

yingtho’s picture

Status: Active » Reviewed & tested by the community

I have testede this and it works.

capellic’s picture

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.

sebasto’s picture

The patch is ok for me too, thx.

mikeytown2’s picture

subscribe, patch works

Anonymous’s picture

subscribe, patch works

isaac.el.cec@gmail.com’s picture

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

nizer’s picture

patch works, thx!

roball’s picture

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.

Lucience’s picture

Thanks dude! The Patch works for me, too.

nickgs’s picture

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