Drupal 7 Custom Module Error

Posted by Bob on Stack Overflow See other posts from Stack Overflow or by Bob
Published on 2011-03-08T23:50:50Z Indexed on 2011/03/09 0:10 UTC
Read the original article Hit count: 202

Filed under:
|

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 :)

© Stack Overflow or respective owner

Related posts about drupal

Related posts about drupal-7