Hi.
Today I updated the Administration Language module to its newest version (7.x-1.0-beta2). After that, my web site's watch dog system began to log lots of messages about a PHP notice, that apparently take place for every page that is visited in my web site.
The message is the following:
Notice: Undefined variable: language in admin_language_language_init() (line 729 of /home/mywebsite/public_html/sites/all/modules/admin_language/admin_language.module).
Is this a bug that has been introduced in this new version of the module? Or am I doing something wrong?
Many thanks in advance! :)
Reis Quarteu
Comments
Comment #2
jcnventuraConfirmed. This last update broke the module for me.. I've reverted to beta1, since I can't get the site to use the defined admin language because of the above error.
Comment #3
hassebasse commentedSame happend to me.
Having this message on the site (but not in admin mode)
Notice: Undefined variable: language in admin_language_language_init() (line 729 of /home/site_name/public_html/sites/all/modules/admin_language/admin_language.module).
Comment #4
vistree commentedSame problem here!
Comment #5
pepe roni commentedI can confirm #3 and reverted to prior version (beta1) as in #2.
But I must say, there are nice new features in the beta2 ;)
Comment #6
ramdas gaikar commentedThe Variable language is unnecessarily used in the code.
I have removed that from code.
Please find the patch will.
Hope it will resolve the issue.
Thanks.
Comment #7
reis quarteu commentedComment #8
reis quarteu commentedI confirm that patch #6 works and gets rid of the log messages. Many Thanks for your kind help, @Ramdas! :)
I also confirm what is written in #3: the log messages don't occur in admin mode. Thanks for your point, @hassebasse! :)
I just wonder if the patch will not affect some functionality of the module.
Best regards!
Comment #9
mohammed76when will we see this patch in a dev version? I even vote for a third beta since this bug broke the functionality for all users.
Comment #10
vistree commentedFor me the backend is still not switched. Instead, the current language is set. Tested as admin user right now
Comment #11
danielmrichards commentedThe issue here is being caused during this modules implementation of
hook_init. On line 729 and 726 it is attempting to use drupals global$languagevariable, without actually instantiating it.So this little patch should get things working again.
Comment #12
fox_01 commented#11 works for me. the errors are gone
Comment #13
vistree commented#11 solves the problem on admin pages. Admin language is used there now!
Comment #14
nssdcg commentedI don´t have enough knowledge to apply the patch (tried to read the Drupal guide for doing it but it might as well be in chinese) could you please just tell me what lines of code need to be changed?
Comment #15
Steff Vanhaverbeke commented@nssdcg
To patch a file:
1) Download the patch file [nameofthepatchfile.patch]
2) Place it in the same directory as the file you'd like to patch. In this case 'admin_language.module'
3) Using a unix/linux command shell, type after the $ sign:
patch < [nameofthepatchfile.patch]If you don't use unix or linux, see https://www.drupal.org/patch/apply
Comment #16
AsadKamil commentedadmin_language-undefined_variable_language-2768897-11.patch, This patch is applied cleanly to 7.x branch
Thanks.
Comment #17
mohammed76Just to confirm, patch in #11 worked for me too.
Comment #18
adrien.felipe commented#11 works for me too. Thanks.
Comment #20
stefan.r commentedComment #21
stefan.r commentedbeta2 was indeed completely broken! Committing this and will tag this as beta3.