If a user only has "access recipe' only access, the module generates a 404 error and displays 'page not found'.

The following code change seems to work:

function recipe_link($type) {

  if ($type == "system") {
    if (user_access("create recipes")) {
      menu("node/add/recipe", t("recipe"), "node_page", 0);
      menu("recipe", t("recipe"), "recipe_page", 0, 1);
    } else 
    if (user_access("access recipes")) {          /* added additional else */
       menu("recipe", t("recipe"), "recipe_page", 0, 1);
    }   
    drupal_set_html_head(recipe_html_head());
  }

  if ($type == "page" && user_access("access recipes")) {
    $links[] = l(t("recipes"), "recipe", array ("title" => t("View the collection of recipes.")));
  }
  return $links ? $links : array();  
}

Comments

Anonymous’s picture

Thanks for the code, whough it took me a little bit to figure out where it went.

I also had a problem with the recipes. When you click on the recipe node, you would see all the recipes, but it would take you to the home page if you click on any of them. I figured out that it was caused by a missing word in the url.

In the

function recipe_list() is a missing line

within the while loop

while ($node = db_fetch_object($result)) {
$rows[] = array(
//My changes change this. Original line is below
// array("data" => l($node->title, "node/$node->nid")),
array("data" => l($node->title, "node/view/$node->nid")),

array("data" => format_name($node)),
array("data" => ($num = comment_num_all($node->nid)) ? $num : " ")
);
}

---------------

I hope that helps someone.

-Jeff

moshe weitzman’s picture

Anonymous’s picture