I have a site with a large number of modules (100+) installed and I have an issue with my rules firing twice, which appears to be caused by user_save()
being called twice. (I was able to confirm this by adding a dpm($account)
in user_save()
, which is printed to the screen twice on my dev site when I log in as an authenticated user and update that user's profile.
Now I'd like to find which contrib module is caused user_save()
to be called twice (of course this assumes it is a contrib module). I'm not a developer so I'm getting stuck. I have Netbeans set up with Xdebug and I set a breakpoint on user_save()
. Then I started the debugger and logged in and updated a user account, but when I look at the call stack I see the following:
/mysite/modules/user/user.module.include_once:424 /mysite/includes/bootstrap.inc.drupal_load:1126
/mysite/sites/all/modules/contrib/devel/devel.module.devel_boot:616
/mysite/includes/module.inc.call_user_func_array:833
/mysite/includes/module.inc.module_invoke:833 /mysite/includes/bootstrap.inc.bootstrap_invoke_all:1097
/mysite/includes/bootstrap.inc._drupal_bootstrap_page_header:2454 /mysite/includes/bootstrap.inc.drupal_bootstrap:2214
/mysite/index.php.{main}:20
And then when user_save()
is called again (in the same page load) I see exactly the same output. If it is a contrib module that is causing user_save()
to be called twice, how can I find out which one it is?
watchdog('debug', '<pre>' . print_r(debug_backtrace(), TRUE) . '</pre>');
into an implementation ofhook_user_insert()
and/orhook_user_update()
might be a good start, it should give you a trace of what functions were called for each run up touser_save()
. Analysing that should give you an idea of what's instigating the calls at leasthook_user_update()
. However, I had to enable syslog because it overloaded the watchdog reports screen; a single save of a user profile generated 685033 lines of text in the syslog file. Is there some way to look at the file and get meaningful information, because there's no way I can read a half million lines of text...