After installing the cosign module I get this when I try to configure the module settings:

Cosign module settings

* warning: Missing argument 1 for drupal_get_form() in /var/www/apache2-default/drupal/includes/form.inc on line 49.
* warning: Missing argument 1 for drupal_retrieve_form() in /var/www/apache2-default/drupal/includes/form.inc on line 179.
* warning: call_user_func_array(): First argumented is expected to be a valid callback, '' was given in /var/www/apache2-default/drupal/includes/form.inc on line 218.

Anybody knows whats happening there?

I've got a clean 5.1 Drupal install.

Thanks,
Makkus

Comments

dhovey’s picture

I've noted that there are two things missing from the file:
a) a callback arguments option in the $items[] array;
b) a function called cosign_admin();

This is what I think it should look like:

function cosign_menu() {

  $items = array();

  $items[] = array(
    'path' => 'admin/settings/cosign',
    'title' => t('Cosign module settings'),
    'callback' => 'drupal_get_form',
    'callback arguments' => ('cosign_admin'),
    'access' => user_access('administer cosign'),
    'type' => MENU_NORMAL_ITEM,
   );

  return $items;
}


function cosign_admin() {

  $form['cosign_maxdisp'] = array(
    '#type' => 'textfield',
    '#title' => t('Some sort of setting goes here'),
    '#default_value' => variable_get('cosign_setting', 'default'),
    '#size' => 10,
    '#maxlength' => 10,
    '#description' => t("The description of the setting.")
  );

  return system_settings_form($form);
}
dhovey’s picture

I've noted that there are two things missing from the file:
a) a callback arguments option in the $items[] array;
b) a function called cosign_admin();

This is what I think it should look like:

function cosign_menu() {

  $items = array();

  $items[] = array(
    'path' => 'admin/settings/cosign',
    'title' => t('Cosign module settings'),
    'callback' => 'drupal_get_form',
    'callback arguments' => ('cosign_admin'),
    'access' => user_access('administer cosign'),
    'type' => MENU_NORMAL_ITEM,
   );

  return $items;
}


function cosign_admin() {

  $form['cosign_setting'] = array(
    '#type' => 'textfield',
    '#title' => t('Some sort of setting goes here'),
    '#default_value' => variable_get('cosign_setting', 'default'),
    '#size' => 10,
    '#maxlength' => 10,
    '#description' => t("The description of the setting.")
  );

  return system_settings_form($form);
}
wnorthway’s picture

Status: Active » Closed (fixed)

Makkus - I'm sorry that you found this confusing. I started including this functionality when I was learning about how to write drupal modules. It turns out that I never did anything with it.

For now, there are no settings to configure with the cosign module. It's either on or off.

Is there a setting that you would like to administer? We could add that functionality.