1 multigroup (Multigroup)
1 textfilefiel

I edit any material, and always see this warning:

warning: array_keys() [function.array-keys]: The first argument should be an array in .../sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 315.
warning: array_keys() [function.array-keys]: The first argument should be an array in .../sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in .../sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.

Comments

gaurishankar’s picture

Priority: Normal » Major

I faced that warning when edit the content type that has cck multigroup field. Have you any solution?
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 315.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 315.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 315.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 315.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 315.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 315.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home8/sumitmis/public_html/trustedpeer/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc on line 281.

RobertoGA’s picture

I was the same, the message appears if there are no required fields in the multigroup ... I have placed a required field inside multigroup and the warnings no longer jumps.

You can see http://drupal.org/node/1097548 if you need more help, they have talked for a while about this problem, good luck.

gaurishankar’s picture

Assigned: Unassigned » gaurishankar
Status: Active » Fixed
StatusFileSize
new9.95 KB

Hey,
I had fixed this warning with this one file or this listed patch. This is the patch corrected file you just have to replace with this one. It works good and tested.
Or
You can make patch file with replacing this one
@@ -278,10 +278,12 @@
*/
function content_multigroup_node_form_pre_render(&$form) {
foreach ($form['#multigroups'] as $group_name => $group_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);
- }
+ if ( !empty( $form['#multigroup_required_fields'][$group_name] ) ) {
+ $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);
+ }
+ }
}
return $form;
}
@@ -312,10 +314,12 @@
// form for an 'Add more values' request.
$required = !empty($form_state['multigroup_add_more']);
foreach ($form['#multigroups'] as $group_name => $group_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, $required);
- }
+ if ( !empty( $form['#multigroup_required_fields'][$group_name] ) ) {
+ $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, $required);
+ }
+ }
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

omar alahmed’s picture

It's working perfectly, thanks very much.

fizk’s picture

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

This hasn't been committed yet.

yched’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new1.54 KB

Committed the attached patch. Thanks !

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.