I've been getting these errors since upgrading to the latest dev release whenever a user's profile page is viewed:

Missing argument 2 for user_category_load(), called in [path_to_drupal]/includes/menu.inc on line 410 and defined in [path_to_drupal]/modules/user/user.module on line 1162.

Missing argument 3 for user_category_load(), called in [path_to_drupal]/includes/menu.inc on line 410 and defined in [path_to_drupal]/modules/user/user.module on line 1162.

Disabling the "Password change tab" module stops this error from occurring. I think this issue may have something to do with what's going on here, but it's really just a guess on my part. I've tried looking at the diff of contrib/password_tab/password_policy_password_tab.module, but I don't see anything obviously wrong.

CommentFileSizeAuthor
#12 password_policy.1131262-110614.patch1.1 KBiva2k

Comments

Yanxi’s picture

Version: 6.x-1.x-dev » 6.x-1.0

I started to get this warning message after upgrading to the latest stable version. It looks like quite a few tab-related modules have had the same problem. Any patches available to fix this one?

iva2k’s picture

I tracked that through the menu router to line (23) in password_policy_password_tab.module:

    'user/%user_category/edit/password' => array(

Changing it to:

    'user/%user/edit/password' => array(

and clearing caches seems to resolve the problem. Though I did not test if it does not break anything else.

earth1’s picture

sterndata’s picture

Assigned: Unassigned » earth1

I can confirm this on my system, too. I disabled the password change tab module and things are OK again.

earth1’s picture

I can put the password_tab: module/password_policy/contrib/password_tab -> module/password_tab.

rj’s picture

iva2k's solution from #2 fixed the issue on my system...

hbergin’s picture

The problem also went away for me when I disabled the password change tab module.

The system seemed to have been working OK before Password Policy was upgraded to version 1.0. When I switched the Password Policy module back to version 6.x-1.0-beta1 on another system showing the same behaviour, it too started working again with no errors.

roball’s picture

Title: "Missing argument 3 for user_category_load()" with latest dev release » "Missing argument 3 for user_category_load()" PHP errors caused by "Password change tab" module

Exactly the same issue here with 1.0.

dppeak’s picture

You need to add 'load arguments' to the menu definition.

So in the password_policy_password_tab.module after line 29, add:

'load arguments' => array('%map', '%index'),

Final result would look like:

    'user/%user_category/edit/password' => array(
      'title' => 'Password',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('password_policy_password_tab', 1),
      'access callback' => 'user_edit_access',
      'access arguments' => array(1),
      'type' => MENU_LOCAL_TASK,
      'load arguments' => array('%map', '%index'),
      'file' => 'password_policy_password_tab.pages.inc',
    ),

You will also need to add a hook_user to the module to register "password" as a category.

After line 34, add the following:


/**
 * Implementation of hook_user().
 */
function password_policy_password_tab_user($op, &$edit, &$account, $category = NULL) {
  if ($op === 'categories') {
    return array(array(
      'name' => 'password',
      'title' => t('Password'),
      'weight' => 0,
    ));
  }
}
roball’s picture

Great. Could you please post these changes as a patch?

adnanhader’s picture

Issue tags: +Password Policy

Thanks. #9 worked for me.

iva2k’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.1 KB

Patch from #9 (apply to password_policy module level).
Confirm it works and fixes the problem. Makes more sense than my hack in #2.

wxman’s picture

#12 patch worked for me as well.

roball’s picture

Priority: Normal » Major

Patch from #12 and flushing all caches perfectly fixed the problems here also. Please commit!

Crom’s picture

ditto - Please commit. thanks.

erikwebb’s picture

Status: Reviewed & tested by the community » Fixed
roball’s picture

Version: 6.x-1.0 » 6.x-1.1
sterndata’s picture

Status: Fixed » Active

Fix does not work with version 6.x.1.1 with password tab module enabled:

warning: Missing argument 2 for user_category_load(), called in /var/www/vhosts/breadboard.greatharvest.com/httpdocs/includes/menu.inc on line 411 and defined in /var/www/vhosts/breadboard.greatharvest.com/httpdocs/modules/user/user.module on line 1155.
warning: Missing argument 3 for user_category_load(), called in /var/www/vhosts/breadboard.greatharvest.com/httpdocs/includes/menu.inc on line 411 and defined in /var/www/vhosts/breadboard.greatharvest.com/httpdocs/modules/user/user.module on line 1155.

roball’s picture

This is because the bug does still exist in 1.1. Thus I have updated the affected version number.

erikwebb’s picture

Status: Active » Fixed

6.x-1.1 was pushed out for a critical bug. If you can try with 6.x-1.x-dev, please confirm the issue is resolved. There were only a few insignificant fixes added after 6.x-1.1, so I'll likely push a 6.x-1.2 release after those fixed bugs are confirmed fixed.

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