[development] Problem I am unable to locate

Erik Stielstra info at erikstielstra.nl
Wed Jan 13 11:21:25 UTC 2010


Nothing wrong with the code. I build a module out of it and got to the admin/settings/time_card page without errors.

Erik Stielstra



On 13 jan 2010, at 06:07, Cory Gilliam wrote:

> Starting a new module and cant find the solution for this problem.  I am trying to check the admin settings page for the module, and I am getting this error:
> 
> Invalid argument supplied for foreach() in /home/dangerou/public_html/includes/menu.inc on line 258.
> 
> Here is the code in the .module:
> 
> function time_card_menu() {
>   $items['admin/settings/time_card'] = array(
>     'title' => 'Time card settings',
>     'description' => 'Change how time card behave.',
>     'page callback' => 'drupal_get_form',
>     'page arguments' => array('time_card_admin_settings'),
>     'access arguments' => array('administer site configuration'),
>     'type' => MENU_NORMAL_ITEM,
>     'file' => 'time_card.admin.inc',
>   );
>     
>  return $items;
> }
> 
> Here is the code in the .inc:
> 
> function time_card_admin_settings() {
>     $options = array('weekly' => 'Weekly');
> 
>     $form['time_card_pay_periods'] = array(
>       '#type' => 'checkboxes',
>         '#title' => t('Your Pay Period is:'),
>         '#options' => $options,
>         '#default_value' => variable_get('time_card_pay_periods', array('weekly')),
>         '#description' => t('This will tell the system how many weeks of information to collect for hour totals.'),
>   );
> 
>   return system_settings_form($form);
> 
> }
> 
> What is it that I am not seeing.



More information about the development mailing list