I have enabled the predefined view "People, Emulates the Drupal user administration page". I changed the path from admin/people2 to admin/people so that this view will be accessible from the default links in the menu. My problem is right after I change the path and proceed to the user admin page the "Add User" option results in a 404 page not found error.

I am not sure why this is happening. My customer needs the robust options that views gives them, but also have frequent users that need to be manually added. Any help would be greatly appreciated.

Comments

bojanz’s picture

Odd.
What is the (add user) path that gives a 404?

gratefulsk’s picture

It's the default path set by Drupal which is /admin/people/create

colin_young’s picture

I can confirm the behavior. When I switch the path of the view back to admin/people2, the create path works again.

bojanz’s picture

Category: bug » support
Status: Active » Fixed

Looked into this.
Seems that you can't just override a system path, child items (like the "create" one) get messed up.
Your best bet is to download Administration menu, it comes with a module named "Administration views" that will replace all your system lists (content, people, comments, taxonomy) with VBO-enabled views. It implements a special views display plugin so that the child items continue to work.

colin_young’s picture

Excellent. That will solve several problems for me at once :)

gratefulsk’s picture

This works good, but it seems that the Comment Approval page gets disabled. www.example.com/admin/content/comment/approval

bojanz’s picture

You can report that in the "Administration menu" issue queue.

Status: Fixed » Closed (fixed)

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

giorgosk’s picture

took me some time to find this thread

I was looking for "Missing argument 2 for views_page() in views_page()" which is the actual warning message that comes up when visiting admin/people/create after changing the VBO user view to admin/people

just mentioning it just in case someone else is looking using previous phrase

jessehs’s picture

This is likely the same issue I ran into with VBO for Drupal 6. The problem, I think, is that the Drupal core User module specifies only one callback function for the /admin/user/user path. With both /admin/user/user/list and /admin/user/user/create, they fall back to using that same callback function. When you take over that path with Views, the "admin/user/user/create" path's callback function is no longer found, since it's parent now has a different callback function.

The solution is simple: tell the /admin/user/user/create path where to find its callback function. Implement a hook_menu_alter in a custom module:

/**
 * Implementation of hook_menu_alter().
 */
function my_module_menu_alter(&$items) {
  // Re-point the /admin/user/user/create path back to the User module's
  // callback, since Views is taking over /admin/user/user.
  $items['admin/user/user/create']['page callback'] = 'user_admin';
}

By the way, in the view, I set the path to "admin/user/user/list" and set its menu item to be the "default menu tab" called "List". For its settings, I set its parent to be "Menu tab" named "Users". This results in the standard behavior from Core.

dozymoe’s picture

@jessehs thanks, YOU MAN, saved my life :o .

BarisW’s picture

Version: 7.x-3.0-beta3 » 7.x-3.x-dev

For Drupal 7, it should be this:

<?php
/**
 * Implementation of hook_menu_alter().
 */
function my_module_menu_alter(&$items) {
  // Re-point the /admin/user/user/create path back to the User module's
  // callback, since Views is taking over /admin/user/user.
  $items['admin/people/create']['page callback'] = 'user_admin';
  $items['admin/people/create']['file'] = 'user.admin.inc';
}
?>
geerlingguy’s picture

Issue summary: View changes

+1 to @BarisW's code snippet above, though formatted a little more correctly/succinctly, it should be:

/**
 * Implements hook_menu_alter().
 */
function mymodule_menu_alter(&$items) {
  // Fix the admin/people/create, since this module overrides /admin/people.
  $items['admin/people/create']['page callback'] = 'user_admin';
  $items['admin/people/create']['file'] = 'user.admin.inc';
}