Closed (duplicate)
Project:
Disable user language
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2011 at 18:26 UTC
Updated:
9 Sep 2013 at 20:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mangru commentedproblem 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');
}
}
}
Comment #2
mangru commentedComment #3
Anonymous (not verified) commentedI 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.
Comment #4
P3t3r commentedThe 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.
Comment #5
Anonymous (not verified) commentedIf 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:
Comment #6
irowboat commented#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.
Comment #7
Anonymous (not verified) commentedBoth the extension and #5 don't work.
Comment #8
oscardax commented#1 is working for me. Thanks!!
Comment #9
Andre-Bignore this patch
Comment #10
Andre-Bcreated 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']
Comment #11
bennetteson commentedAs #1050584: Missing argument 2 for dul_user_load() is not yet merged, we should close this issue (for now only revert it as active).
Comment #12
jvandooren commented#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
Comment #13
Anonymous (not verified) commentedSee #1050584: Missing argument 2 for dul_user_load().