Hello,

I receive the following error message when the checkbox "Redirect on User Edit page" is activated:

warning: Missing argument 2 for user_category_load(), called in D:\DEVELOPMENT\xampp\www\mysite.tld\includes\menu.inc on line 410 and defined in D:\DEVELOPMENT\xampp\www\mysite.tld\modules\user\user.module on line 1160.

I have to un-install the module to get rid of it. De-activating the checkbox does not help.
I use Drupal 6.19 with content_profile 6.x-1.0 on PHP 5.2.

Please let me know if you need more information.
Thank you very much for this great module. It's such a big usability improvement in profile handling! :)

Stefan

CommentFileSizeAuthor
#11 account_profile.tgz40 KBszantog

Comments

Q2U’s picture

Same problem here...

Account Profile 6.x-1.x-dev (2010-Dec-01)

•warning: Missing argument 2 for user_category_load(), called in /home2/florids6/public_html/includes/menu.inc on line 410 and defined in /home2/florids6/public_html/modules/user/user.module on line 1160.
•warning: Missing argument 3 for user_category_load(), called in /home2/florids6/public_html/includes/menu.inc on line 410 and defined in /home2/florids6/public_html/modules/user/user.module on line 1160.
..
kenorb’s picture

Status: Active » Closed (duplicate)
design.er’s picture

no, I'm not using the 'me' module.

kenorb’s picture

Status: Closed (duplicate) » Active

menu.inc on line 410

          $return = $function($value);
382	          // Set up arguments for the load function. These were pulled from
383	          // 'load arguments' in the hook_menu() entry, but they need
384	          // some processing. In this case the $function is the key to the
385	          // load_function array, and the value is the list of arguments.
Function: _menu_load_objects()
/* Loads objects into the map as defined in the $item['load_functions']. */

user.module

/**
1160	 * Return a user object after checking if any profile category in the path exists.
1161	 */
1162	function user_category_load($uid, &$map, $index) {

So it's probably some conflict with other module, which uses 'load arguments' in hook_menu
I haven't got idea why does it happen.

Can you test the patch provided here?
#929344: Integration with 'me' module

guidot’s picture

Using the latest dev I get the same error-messages as #1 and additionally an "Access denied". I'm logged in as user 1.

I tried patch 929344-1 from #929344: Integration with 'me' module (in comment #5) without success.

Of all enabled modules on my site I have found the following files in sites/all/modules contain a hook_menu (simply by grepping for "Implementation of hook_menu", is there a better way?):

imageapi/imageapi.module
imagecache/imagecache.module
imagecache/imagecache_ui.module
l10n_update/l10n_update.module
messaging/messaging_simple/messaging_simple.module
messaging/messaging.module
notifications/notifications.module
notifications/notifications_content/notifications_content.module
og/modules/og_views/og_views.module
og/modules/og_notifications/og_notifications.module
og/og.module
og_mandatory_group/og_mandatory_group.module
og_username_helper/og_username_helper.module
panels/panels.module
panels/panels_node/panels_node.module
panels/panels_mini/panels_mini.module
panels/panels_mini/panels_mini.admin.inc
rules/rules_admin/rules_admin.module
skinr/skinr.module
views/views.module
views/views_ui.module
wysiwyg/wysiwyg.module

Don't know if that helps. If you have any idea what else I could do to help, let me know.

kenorb’s picture

If you have access to command line, can you search for "load arguments" and "menu_alter"

> cd sites/all/modules
> grep -Rl "load arguments" . | grep -v svn
> grep -Rl "menu_alter" . | grep -v svn

Thanks.

guidot’s picture

This is what I got (excluding disabled modules):

> grep -Rl "load arguments" . | grep -v svn
./views/plugins/views_plugin_display_page.inc
./views/views.module
./rules/rules_admin/rules_admin.module
./ctools/includes/export-ui.inc
> grep -Rl "menu_alter" . | grep -v svn
./views/views.module
./views/includes/view.inc
./privatemsg/privatemsg_filter/privatemsg_filter.module
./account_profile/account_profile.module
./account_profile/account_profile-929344-1.patch
./account_profile/account_profile.module.orig
./admin_menu/admin_menu.module
./og/og.module
./cck/content.module
./advanced_help/advanced_help.module
./date/date_api.module
./content_profile/content_profile.module
./l10n_update/l10n_update.module
robotjox’s picture

same problem here - subscribing

lewie6’s picture

same problem too

lewie6’s picture

i had some hook_menu_alters in a custom module. when i removed them and 'rebuilt menu' (using devel) the error goes away.

szantog’s picture

StatusFileSize
new40 KB

Hi all!
I attach a tarball with some other correction. Please try it in a dev site, imho it fixes this problem too.

kenorb’s picture

Status: Active » Needs review
gedur’s picture

Hi! Thanks for your solution but I can apply any of your patchs , it gives me an error on some lines:

Hunk #1 FAILED at 57.
Hunk #2 succeeded at 147 (offset 27 lines).
Hunk #3 FAILED at 129.

In the folder the are two patchs, Do I need to appy both sequentially?

Thx

kenorb’s picture

Status: Needs review » Needs work
snowmountain’s picture

I also have this same warning, different line numbers, on page /user :

warning: Missing argument 2 for user_category_load(), called in .../public_html/includes/menu.inc on line 411 and defined in .../public_html/modules/user/user.module on line 1155.
warning: Missing argument 3 for user_category_load(), called in .../public_html/includes/menu.inc on line 411 and defined in .../public_html/modules/user/user.module on line 1155.

However, I don't even have account profile installed at all!

I DO have content profile 6.x-1.0 and profile 6.22 installed, and am NOT using the 'me' module.

So, perhaps this problem lies elsewhere.

mattcasey’s picture

I just noticed that when ' Redirect on User Edit page' is checked, it redirects to the wrong URL. It uses "user/X/edit/profile" when the correct path to my content profile is "user/X/profile/profile" If I put that path in instead, it works.

[UPDATE]
I manually updated the hook_form_alter in #11 and it fixed the issue for me. If you don't want to hack the module, one could also try setting the Content Profile to only "appear as a tab underneath Profile" from the content profile settings for the content type, because then it uses the path: edit/profile instead of profile/profile

PixelClever’s picture

Status: Needs work » Needs review

I fixed mine by changing a few lines starting at line 44:

global $user;
if (isset($_REQUEST['destination'])) {
  $destination = $_REQUEST['destination'];
   unset($_REQUEST['destination']);
     drupal_goto('user/'.$user->uid.'/profile/'.$profile, array('destination' => $destination));
   }
   else {
     drupal_goto('user/'.$user->uid.'/profile/'.$profile);
   }
mistri’s picture

Hey snowmountain,

Did you finally get around this error in the end? I have exactly the same error (lines 411 and 1155 in menu.inc and user.module) - they refer to
$return = $function($value); and
function user_category_load($uid, &$map, $index) respectively.
I have tried going through all the modules I have installed and i cannot see which one it is being affected by. I have logintoboggan module with Front_page and that is fine. I disabled Content Profile but am still getting the error.
Thanks for getting back soon!

iRex’s picture

subscribing

snowmountain’s picture

Sorry, I've been pretty busy lately. No progress yet.

jippie1948’s picture

applied #17, still same problem... :-(

frosty29’s picture

Thanks #16 - that led to the answer which solves my problem.
I didn't see #17 before I did my own clunky fix in account_profile.module (about line 42):

    case 'user_profile_form':
        if (variable_get('account_profile_redirect', TRUE)) {
          if (isset($_REQUEST['destination'])) {
            $destination = $_REQUEST['destination'];
            unset($_REQUEST['destination']);
            $q = $_GET['q'];
            $editpos=strpos($q,'/edit');
            if ($editpos!==false){
            	$q=substr($q,0,$editpos);
            }
            drupal_goto($q . "/profile/$profile/", array('destination' => $destination));
          }
          else {
             drupal_goto($_GET['q'] . "/$profile");
          }
          // header("Location: " . base_path() . $_GET['q'] . "/$profile");
          exit;
        }
    break;

I can keep the account profile settings I needed and all my errors have apparently now gone.

jippie1948’s picture

Sorry, it did not work for me.

wm753v’s picture

I installed Password Policy module, and it happened. As soon as I uninstalled it, the errors disappeared. I don't know how to install this module without getting the errors.

arski’s picture

sub

iRex’s picture

I had this issue on several sites that I built, and each time, like #24, I solved it by remove the Password Policy module. I think that's where the problem lies.

gbirch’s picture

I had this problem in a site that did NOT have password policy installed.
The fix in #17 seems to be the right approach, but only works if the currently logged in user is editing his or her own profile, NOT if the admin is trying to do so.
Alternative fix that seems to work for BOTH users and admins is to edit
function account_profile_form_alter in account_profile.module as follows:

//...
   case 'user_profile_form':
        if (variable_get('account_profile_redirect', TRUE)) {
          if (isset($_REQUEST['destination'])) {
            $destination = $_REQUEST['destination'];
            unset($_REQUEST['destination']);
//            drupal_goto($_GET['q'] . "/$profile", array('destination' => $destination));
            drupal_goto('user/'.arg(1).'/profile/'.$profile, array('destination' => $destination));
            
          }
          else {
            drupal_goto('user/'.arg(1).'/profile/'.$profile);
//             drupal_goto($_GET['q'] . "/$profile");
          }
          // header("Location: " . base_path() . $_GET['q'] . "/$profile");
          exit;
        }
    break;
queryblitz’s picture

Thanks gbirch! That worked after clearing the cache. Big help.

kenorb’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Closing as per Drupal 6 end-of-life. Unless somebody can provide a clean patch.