i get after enabling the module this message:

Warning: Parameter 1 to user_tweaks_user_load() expected to be a reference, value given in DrupalDefaultEntityController->attachLoad() (line 334 of C:\xampp\xampplite\htdocs\funnydate\includes\entity.inc).

Comments

pafla’s picture

I got this message too

espirates’s picture

I got this one

Fatal error: Call to a member function forceMenuRebuild() on a non-object in /sites/all/modules/user_tweaks/user_tweaks_ui.module on line 90

DonBeisser’s picture

StatusFileSize
new10.79 KB

I got this Message after changing the name of an User Profile ( for e.g. main profile to Profile )
can someone tell me why

peteror’s picture

Yep, there is a typo there, just change

$var->forceMenuRebuild();
to
$vars->forceMenuRebuild();

in user_tweaks_ui.module, line 90 (the one before the last line...)

Anonymous’s picture

What's the solution to the original problem?

Anonymous’s picture

Title: Error Message » The parameter for user_tweaks_load() is expected to be a reference
Anonymous’s picture

I have marked #1310568: Missing argument 2 for user_tweaks_user_load() as duplicate of this report.

janchojnacki’s picture

In user_tweaks.module change:
function user_tweaks_user_load(&$account) {
to:
function user_tweaks_user_load($account) {

rawrzors’s picture

Any updates on this issue?

I tried jaanhoinatski's solution, but I could not find the exact statement. The closest thing is:

function user_tweaks_user_load(&$edit, &$account, $category = NULL) {
  $vars = new UserTweakVars();

  if ($vars['user_tweaks_disable_user_language'] && $account->uid && !user_access('change own user language', $account)) {
    $account->language = language_default('language');
  }
}

Any suggestions?

Thanks

sinasalek’s picture

Same here :
Notice: Undefined variable: var in user_tweaks_ui_config_submit() (line 90 of sites/all/modules/user_tweaks/user_tweaks_ui.module).

Also when i save this page dmin/config/people/user-tweaks , it goes blank

asghar’s picture

Hi
Getting Warning "Parameter 1 to user_tweaks_user_load() expected to be a reference, [warning] value given entity.inc:335"
I think module author is using wrong hook_user_load format

/**
 * Implements hook_user_load().
 */

function user_tweaks_user_load(&$edit, $account, $category = NULL) {
  $vars = new UserTweakVars();

  if ($vars['user_tweaks_disable_user_language'] && $account->uid && !user_access('change own user language', $account)) {
    $account->language = language_default('language');
  }
}

It should be change user_tweaks_user_load(&$edit, $account, $category = NULL) to user_tweaks_user_load($users) http://api.drupal.org/api/drupal/modules!user!user.api.php/function/hook...

asghar’s picture

I think it should work I am not familar this module function i am facing warning issue when i clear the cache or run drupal updation

/**
 * Implements hook_user_load().
 */
function user_tweaks_user_load($users) {
  foreach($users as $account) {
    $vars = new UserTweakVars();
  
    if ($vars['user_tweaks_disable_user_language'] && $account->uid && !user_access('change own user language', $account)) {
      $account->language = language_default('language');
    }
  } 
}
NoRandom’s picture

Right use of the hook, asghar, and it solves the error message.

bagqueen’s picture

Issue summary: View changes

Is the code that asghar posted in comment #12 supposed to be correct? When I try to use it I get this error message:
Notice: Undefined variable: account in user_tweaks_user_load() (line 355 of sites/all/modules/user_tweaks/user_tweaks.module).
Notice: Trying to get property of non-object in user_tweaks_user_load() (line 355 of sites/all/modules/user_tweaks/user_tweaks.module).

lammensj’s picture

Converted the code from asghar to a patch. Worked on my local development site.

pawel_r’s picture

7.x-2.0-alpha3 has still typo '$var' not fixed, proper line in 'user_tweaks_ui_config_submit()' should be
$vars->forceMenuRebuild();