0
votes

i wrote a custom module for drupal 7, placed the folder and needed files under /sites/all/modules/module_name and enabled via the backend. This is my hook_menu function;

function blog_contact_settings_menu(){
    $items = array();
    $items["blog_contact/send_to_all"] = array(
        "title"=>"Mail all bloggers",
        "page callback"=>"drupal_get_form",
        "page arguments"=>array("blog_contact_page"),
        "access arguments"=>array("access content")
    );
    $items["blog_contact/send_to_one"] = array(
        "page_callback"=>"single_blogger_contact",
        "access_arguments"=>array("access content"),
        "type"=>MENU_CALLBACK
    );
    return $items;
}

My blog contactpage is suppoused to return a page with form but when i go to the /?q=blog_contact/send_to_all, it gives a 404. why happens that you little Einsteins?

1

1 Answers

1
votes
  • Try clearing cache (Admin > Config > Development > Performance > Clear all caches).
  • Does your blog_contact_page function return a form array ?
  • According to your function name, your module's machine name should be "blog_contact_settings". Nothing else will work.
  • You can check if your function gets called by adding some snippet like the one below to your hook_menu function.

    drupal_set_message('Hook menu function fired!');