Drupal 7 Custom Module Error
- by Bob
I'm playing with a custom module in Drupal, but it gives me the following two warnings:
Warning: Invalid argument supplied for foreach() in menu_unserialize() (line 377 of /site/includes/menu.inc).
Warning: Invalid argument supplied for foreach() in menu_unserialize() (line 377 of /site/includes/menu.inc).
Here is the module's code:
<?php
function homepage_coords_menu(){
$items = array('homepage_coords/%/%/%' => array(
'page callback' => 'homepage_coords_ajax_callback',
'page arguments' => array(1,2,3),
'access arguments' => TRUE,
'type' => MENU_CALLBACK,
));
return $items;
}
function homepage_coords_ajax_callback($nid=0,$x=0,$y=0){
return 'nid:'.$nid.' x:'.$x.' y:'.$y;
}
?>
What can I do to fix these warnings?
Also any effeciency improvements would be appreciated :)