Closed (fixed)
Project:
Drupal core
Version:
7.14
Component:
other
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2012 at 13:18 UTC
Updated:
13 Aug 2012 at 02:11 UTC
Error message on page where must be my settings form:
Notice: Undefined index: #attributes in theme_container() (line 3234 of /www/includes/form.inc).
Recoverable fatal error: Argument 1 passed to drupal_attributes() must be an array, null given, called in /www/includes/form.inc on line 3234 and defined in drupal_attributes() (line 2296 of /www/includes/common.inc).
Here is the code which generate this error, but why i don't know.
mymodule.module:
function mymodule_menu() {
$items = array();
$items['admin/config/system/mysettings'] = array(
'title' => 'My module settings',
'description' => 'This is my module settings.',
'page callback' => 'mymodule_admin',
'file' => 'mymodule.admin.inc',
'type' => MENU_NORMAL_ITEM,
'access arguments' => array('access administration pages'),
);
return $items;
}
mymodule.admin.inc:
function mymodule_admin() {
$form = array();
$form['mymodule_settings'] = array(
'#type' => 'fieldset',
'#title' => t('my module settings'),
);
return system_settings_form($form);
}
Is it normal? Or my mistake?
And nevermind what type of form element you will use. Error is coming again and again.
Comments
Comment #1
stevenpatzComment #2
f1mishutka commentedI have exactly the same issue with my module
UPD: solved
Comment #3
f1mishutka commentedSolution
Replace
to
in mymodule_menu()
And don't fogte to flush menu cache.
Comment #4
payalord commentedThank you!