Hi,

Item 20 of "Converting 5.x modules to 6.x" (node/add is now menu generated) states that the "node/add/$type" menu items are now auto-generated by the menu system and should not be declared in hook_menu(). When they are, it causes that add node page to not work, see issue #178138 for more info on this. Could you add a check to the coder module so it automatically detects the exists of such items in hook_menu() and gives a critical warning? It might save others the problems I experienced.

Cheers,
Stella

Comments

douggreen’s picture

I'm swamped right now. Could you please try to write the rule yourself, and submit a patch? See http://drupal.org/node/144172 for documentation. Thanks.

stella’s picture

Hi,

I can attach a proper patch if you want, but I was unsure if you applied a certain logic/order to the layout of your rules.

The new rule would be:

    array(
      '#type' => 'regex',
      '#function' => '_menu$',
      '#value' => 'node\/add\/',
      '#source' => 'all',
      '#warning_callback' => '_coder_6x_menu_node_add_warning',
    ),

While the new callback warning function could be something like:

function _coder_6x_menu_node_add_warning() {
  return t('The node/add/$type menu items are now auto-generated by the menu system in 6.x. You should not declare them in your menu hook. See <a href="@url">node/add is now menu generated</a>.',
    array(
      '@url' => url('http://drupal.org/node/114774#node_add_summary'),
    )
  );
}

Cheers,
Stella

douggreen’s picture

Status: Active » Fixed

Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)