I am writing my first custom module for drupal 5.
my menu item looks like this:
$items[] = array(
'access' => $access,
'callback' => 'drupal_get_form',
'callback arguments' => 'vcsshop_delete',
'path' => 'admin/content/vcsshop/delete',
'title' => t('Delete catalog item'),
'type' => MENU_CALLBACK,
);
the link you click on looks like: http://example.com/index.php?q=admin/content/vcsshop/delete/2
I get lots of errors and stuff when I click it. I tracked the problem to menu_execute_active_handler in menu.inc. The code:
// We found one, and are allowed to execute it.
$arguments = isset($menu['callbacks'][$path]['callback arguments']) ? $menu['callbacks'][$path]['callback arguments'] : array();
$arg = substr($_GET['q'], strlen($path) + 1);
if (strlen($arg)) {
$arguments = array_merge($arguments, explode('/', $arg));
}
$arguments is a string, not an array, so array_merge complains. I see in the php doc's that in php5 it was changed to require arrays. I changed the code to this:
// We found one, and are allowed to execute it.
$arguments = isset($menu['callbacks'][$path]['callback arguments']) ? Array($menu['callbacks'][$path]['callback arguments']) : array();