1. Create content type Company(see code below)
2. Add new content with type 'Company'.
and we get a message:
* warning: array_keys() [function.array-keys]: The first argument should be an array in C:\opt\Apache2\htdocs\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 C:\opt\Apache2\htdocs\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 C:\opt\Apache2\htdocs\modules\cck\modules\content_multigroup\content_multigroup.node_form.inc on line 281.
2. Fill 'Title' field and press 'Save'
New content was created. But with warning:
* warning: array_keys() [function.array-keys]: The first argument should be an array in C:\opt\Apache2\htdocs\modules\cck\modules\content_multigroup\content_multigroup.node_form.inc on line 315.
* warning: Invalid argument supplied for foreach() in C:\opt\Apache2\htdocs\modules\riverock\link_validator.module on line 32.
$content['type'] = array (
'name' => 'Company',
'type' => 'company',
'description' => '',
'title_label' => 'Title',
'body_label' => 'Body',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'revision' => true,
'promote' => false,
'sticky' => false,
),
'show_preview_changes' => true,
'show_diff_inline' => false,
'enable_revisions_page' => true,
'old_type' => 'company',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
'comment' => '0',
'comment_default_mode' => '4',
'comment_default_order' => '1',
'comment_default_per_page' => '50',
'comment_controls' => '3',
'comment_anonymous' => 0,
'comment_subject_field' => '1',
'comment_preview' => '1',
'comment_form_location' => '0',
);
$content['groups'] = array (
0 =>
array (
'label' => 'Company IDs',
'group_type' => 'multigroup',
'settings' =>
array (
'form' =>
array (
'style' => 'fieldset',
'description' => '',
),
'display' =>
array (
'description' => '',
'teaser' =>
array (
'format' => 'hidden',
'exclude' => 1,
),
'full' =>
array (
'format' => 'fieldset_collapsible',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
2 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
3 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'token' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'label' => 'above',
),
'multigroup' =>
array (
'subgroup' =>
array (
'weight' => -20,
'label' => 'above',
'teaser' =>
array (
'format' => 'table-multiple',
'exclude' => 0,
),
'full' =>
array (
'format' => 'table-multiple',
'exclude' => 0,
),
),
'multiple-columns' => 1,
'required' => 0,
'multiple' => '1',
'labels' =>
array (
0 => '',
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
6 => '',
7 => '',
8 => '',
9 => '',
),
),
),
'weight' => '8',
'group_name' => 'group_company_id',
'parent' => '',
),
1 =>
array (
'label' => 'Revenue',
'group_type' => 'multigroup',
'settings' =>
array (
'form' =>
array (
'style' => 'fieldset_collapsible',
'description' => '',
),
'display' =>
array (
'description' => '',
'teaser' =>
array (
'format' => 'hidden',
'exclude' => 1,
),
'full' =>
array (
'format' => 'fieldset_collapsible',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
2 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
3 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'token' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'label' => 'above',
),
'multigroup' =>
array (
'subgroup' =>
array (
'weight' => -20,
'label' => 'above',
'teaser' =>
array (
'format' => 'table-multiple',
'exclude' => 0,
),
'full' =>
array (
'format' => 'table-multiple',
'exclude' => 0,
),
),
'multiple-columns' => 1,
'required' => 0,
'multiple' => '1',
'labels' =>
array (
0 => '',
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
6 => '',
7 => '',
8 => '',
9 => '',
),
),
),
'weight' => '10',
'group_name' => 'group_revenue',
'parent' => '',
),
);
$content['fields'] = array (
0 =>
array (
'label' => 'ID type',
'field_name' => 'field_id_type',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '23',
'description' => 'NASDAQ : NASDAQ Stock exchange.
NYSE : New York Stock exchange.
LSE : London Stock exchange.
DNB : Dun & Bradstreet.
INN : Russian INN.
BBB : Better Business Bureau.
Other : Also type in value field actual type.
',
'default_value' =>
array (
0 =>
array (
'value' => NULL,
),
),
'default_value_php' => '',
'default_value_widget' => NULL,
'group' => 'group_company_id',
'required' => 0,
'multiple' => '1',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'NASDAQ | NASDAQ
NYSE | NYSE
LSE | LSE
DNB | DNB
INN | INN
BBB | BBB
UNK | Other',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '23',
'parent' => 'group_company_id',
'label' =>
array (
'format' => 'above',
),
'teaser' =>
array (
'format' => 'hidden',
'exclude' => 1,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'token' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
1 =>
array (
'label' => 'ID value',
'field_name' => 'field_id_value',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '24',
'rows' => 5,
'size' => '20',
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_id_value][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_id_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_id_value][0][value',
),
),
),
'group' => 'group_company_id',
'required' => 0,
'multiple' => '1',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '24',
'parent' => 'group_company_id',
'label' =>
array (
'format' => 'above',
),
'teaser' =>
array (
'format' => 'hidden',
'exclude' => 1,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'token' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
2 =>
array (
'label' => 'Year',
'field_name' => 'field_revenue_year',
'type' => 'number_integer',
'widget_type' => 'number',
'change' => 'Change basic information',
'weight' => '9',
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_revenue_year][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_revenue_year' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_revenue_year][0][value',
),
),
),
'group' => 'group_revenue',
'required' => 1,
'multiple' => '1',
'min' => '2000',
'max' => '3000',
'prefix' => '',
'suffix' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'number',
'widget_module' => 'number',
'columns' =>
array (
'value' =>
array (
'type' => 'int',
'not null' => false,
'sortable' => true,
),
),
'display_settings' =>
array (
'weight' => '9',
'parent' => 'group_revenue',
'label' =>
array (
'format' => 'above',
),
'teaser' =>
array (
'format' => 'hidden',
'exclude' => 1,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
),
),
3 =>
array (
'label' => 'Value',
'field_name' => 'field_revenue_value',
'type' => 'number_integer',
'widget_type' => 'number',
'change' => 'Change basic information',
'weight' => '10',
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_revenue_value][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_revenue_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_revenue_value][0][value',
),
),
),
'group' => 'group_revenue',
'required' => 1,
'multiple' => '1',
'min' => '0',
'max' => '',
'prefix' => '',
'suffix' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'number',
'widget_module' => 'number',
'columns' =>
array (
'value' =>
array (
'type' => 'int',
'not null' => false,
'sortable' => true,
),
),
'display_settings' =>
array (
'weight' => '10',
'parent' => 'group_revenue',
'label' =>
array (
'format' => 'above',
),
'teaser' =>
array (
'format' => 'hidden',
'exclude' => 1,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
),
),
);
$content['extra'] = array (
'title' => '3',
'body_field' => '4',
'revision_information' => '12',
'author' => '14',
'options' => '13',
'comment_settings' => '15',
'menu' => '11',
'path' => '16',
);
Comments
Comment #1
tomsm commentedI have the same warning after updating from alpha2 to alpha3 when I want to create a node that has multigroup fields. I think it is related to this issue: http://drupal.org/node/1097548 because I only have it with a content type with multigroups that are not required.
Comment #2
sergmain commentedPlease ignore last two warning message. They from my module.
Comment #3
lmjabreu commentedI have the same warning with multigroup fields as well.
Comment #4
loopduplicate commented@Imjabreu>> I applied the patch from the link in the comment in #1 and it took care of the warnings.
(http://drupal.org/node/1097548) -> link to other issue
(http://drupal.org/files/issues/1097548-1-multigroup-without-required-fie...)-> link to patch
Comment #5
intyms commentedmarking as duplicate.
The issue #1097548: Warning on node edit form for multigroup without any required fields has a working patch.
Comment #6
lmjabreu commented@loopduplicate Thank you very much, the patch fixed it.
Comment #7
karimb commented@loopduplicate Thank you very much, the patch fixed it.
Comment #8
nicholasstuartwilson commentedWorks like a charm, thanks for your post :-)
Comment #9
sashi.kiran commentedHi,
Thank you very much ....i just added ur patch to my content_multigroup.node_form.inc and thatsit ...error gone and everything working fine....once again thank you very very much..