0

I have even two questions - both are connected to hook_admin_path().

  1. Does menu path 'user/*/edit' and 'user/*/account/edit' are the same, from admin_path perspective and was D7 designed with such functionality? I want menu item 'user/*/account/edit' to be shown on default theme.

When I try to show a menu item with path:

'user/*/account/edit'  - showed on admin theme
'user/*/account/edit1' - showed on default theme

result of path_get_admin_paths():
Array ([admin] => 
admin
admin/*
user/*/cancel
user/*/edit
user/*/edit/*
...
)

checked with:

path_is_admin('user/%user/account/edit'); // TRUE
drupal_match_path('user/%user/account/edit', 'user/*/edit'); // TRUE

2 . I tryed to change it with

function MY_MODULE_admin_paths_alter() {
  $paths = array(
    'user/*/edit' => FALSE,
    'user/*/edit/*' => FALSE,
  );
}

But result of path_get_admin_paths() is the same? No other functions call hook_admin_paths_alter(). As I understand, this function shall be the last and should change admin_path.

Any ideas about that?

1
  • 3
    Look at the documentation again - what's the glaring difference between your function declaration and the example in the docs?
    – Clive
    Nov 15, 2014 at 16:36

1 Answer 1

1

Thank you Clive, I mistakenly used pattern from hook_admin_paths() and not hook_admin_paths_alter() function.

The correct way was:

function MY_MODULE_admin_paths_alter(&$paths) {
  $paths['user/*/edit'] = FALSE;
  $paths['user/*/edit/*'] = FALSE;
}
1
  • You should select this as the correct answer.
    – rooby
    Nov 25, 2014 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.