hello,

i am trying to create a notification settings menu item outside the user's profile settings, but am not sure of the correct path to use.

i have tried: user/$user->uid/notify
and user/uid/notify

but both return a 403 error.

what is the correct path to use, please?

Comments

mdowsett’s picture

subscribing

gracearoha’s picture

Although i generally don't like to hack code, here's what i did for now:

in the code below, i added the 'pid' line where pid= the id# of the parent menu item under which i wanted to place "my notification settings"
in the line below that, i changed type from "MENU_LOCAL_TASK" to "MENU DYNAMIC ITEM"

 if ($user->uid) { // Do not show this on user/0/notify (see #157850!!)
      $items[] = array('path' => "user/$user->uid/notify",
        'title' => t('My notification settings'),
        'callback' => 'drupal_get_form',
        'callback arguments' => array('notify_user_settings_form', $user->uid),
        'access' => user_access('access notify'),
        'pid' => 784,
        'type' => MENU_DYNAMIC_ITEM);
matt2000’s picture

Status: Active » Fixed

The correct way to do this is to implement hook_menu_alter in a custom module.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.