After dul module was enabled, I see this warning:

messageWarning: Parameter 1 to dul_user_load() expected to be a reference, value given in DrupalDefaultEntityController->attachLoad() (line 334 of /var/www/vhosts/auklytes.lt/httpdocs/includes/entity.inc).

Comments

mangru’s picture

problem is in:

/**
* Implements hook_user().
*/
function dul_user_load(&$edit, &$account, $category = NULL) {

because:
7 – 8 hook_user_load($users) //different parameters

Fix:

/**
* Implements hook_user_load().
*/
function dul_user_load($users) {
foreach ($users as $account) {
if ($account->uid && !user_access('change own user language', $account)) {
$account->language = language_default('language');
}
}
}

mangru’s picture

Status: Active » Needs review
Anonymous’s picture

I can confirm that this gets rid of the warning, but the module still doesn't work for me... i.e. the "change own language" permission is unchecked for authenticated users, but they can still change it in their on their own edit user page.

P3t3r’s picture

Priority: Major » Critical

The current version of this module is just broken. Given that the author does not want to release any further versions, the module is critically flawed.

Anonymous’s picture

If anyone is interested, there is a simple workaround for disabling the language selection on the user edit page. Just chuck this in your own custom module:

/**
 * Implements hook_form_FORM_ID_alter()
 *
 * Disable language selection on user profile forms
 **/
function YOUR_MODULE_form_user_profile_form_alter(&$form, &$form_state, $form_id) {
	if (isset($form['locale'])) unset($form['locale']);
}
irowboat’s picture

#5 does not work for me, since locale or anything similar isn't in the form array. Yet the language selector is visible and clearly in the same form. Seems pretty weird.

Anonymous’s picture

Both the extension and #5 don't work.

oscardax’s picture

#1 is working for me. Thanks!!

Andre-B’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new945 bytes

ignore this patch

Andre-B’s picture

StatusFileSize
new430 bytes

created a patch with the contents of #1
to everyone trying to apply the patch, this patch is written against the dev version (7.x-1.x).

the beta version has some other bugs as well (using $form['_account']['#value']) instead of $form_state['user']

bennetteson’s picture

Status: Reviewed & tested by the community » Active

As #1050584: Missing argument 2 for dul_user_load() is not yet merged, we should close this issue (for now only revert it as active).

jvandooren’s picture

#5 does work but you have to make sure that the weight of your custom module is higher than the locale module (and clear the cache after doing that). I ended up using the following (more complete) solution: http://drupal.stackexchange.com/a/56342/2725

Anonymous’s picture

Status: Active » Closed (duplicate)