By jcarreer on
I need to pass the wildcard at the end of this URL to the function accountant_registry_form which is generating a form being retrieved by drupal_get_form. I want to use the wildcard to populate the form with that registry's data as default values.
Here's the menu item's code:
$items['accountant/edit/registry/%'] = array(
'type' => MENU_CALLBACK,
'title' => 'Create Registry',
'page callback' => 'drupal_get_form',
'page arguments' => array('accountant_registry_form',3),
'access callback' => 'user_access',
'access arguments' => array('accountant create registry'),
);
Here is a var_dump of the arguments passed to accountant_registry_form when I goto the URL accountant/edit/registry/5:
array(3) { ["storage"]=> NULL ["submitted"]=> bool(false) ["post"]=> array(0) { } }
Comments
Figured it out.
Again Drupal 6's menu caching foiled me, there was no issue with my code, my cache was just old. I really need to download that devel module.
See Here.
See Here.
Just add &$form_state...
Just add &$form_state as the first parameter of the form function