Closed (fixed)
Project:
Translation Management
Version:
7.x-1.0-beta1
Component:
Documentation
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Created:
4 Apr 2011 at 10:24 UTC
Updated:
4 May 2013 at 08:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
ruth_delattre commentedIt is throwing this error when setting the multilingual options for a menu to either translate or fixed language.
Comment #2
scholli-d commentedI can confirm the bug:
When I click
Structure -> Menus -> edit menu (for main menu) -> list links
I get a white page with the text
Fatal error: Call to undefined function _i18n_variable_init() in /.../modules/translation_management/icl_content/icl_content.menus.inc on line 209
I use version 7.x-1.x-dev of i18n.
Comment #3
damiandab commentedI have the same problem :(
Comment #4
haloola commentedme too
Comment #5
tamsoftware commentedsame here.
Trying a little research in the modules folder, it appears this function doesn't exist. There is a i18n_variable_initialize() function however. This could be a rename. I'll try renaming the four calls and will report.
#grep -R i18n_variable_init *
i18n/i18n_variable/i18n_variable.module: i18n_variable_initialize();
i18n/i18n_variable/i18n_variable.module:function i18n_variable_initialize($language = NULL) {
translation_management/icl_content/icl_content.menus.inc: $i18n_v_orig = _i18n_variable_init($default->language);
translation_management/icl_content/icl_content.menus.inc: $i18n_v_target = _i18n_variable_init($lang->language);
translation_management/icl_content/icl_content.module: $i18n_v_orig = _i18n_variable_init($original->language);
translation_management/icl_content/icl_content.module: $i18n_v_target = _i18n_variable_init($code);
It works ! It seems The Variable Translation module must be activated though.
I now get two notices :
Notice : Trying to get property of non-object in i18n_variable_initialize() (line 53 in (...)/sites/all/modules/i18n/i18n_variable/i18n_variable.module).
Notice : Trying to get property of non-object in i18n_variable_initialize() (line 54 in (...)/sites/all/modules/i18n/i18n_variable/i18n_variable.module).
Comment #6
tamsoftware commentedI'll try to make a patch file, but until I learn how to do that, this is what I did:
In your Drupal 7 installation, go to your sites/all/modules/translation_management folder
go to the icl_content folder inside
change _i18n_variable_init to i18n_variable_initialize in the following files:
icl_content.menus.inc at lines 209 and 219
icl_content.module at lines 2145 and 2146
Save and try. Make sure module MULTILINGUAL - INTERNATIONALIZATION: Variable Translation is activated.
Cheers
Franck Horlaville
TAM Software
Comment #7
tebb commentedGetting the same error.
Comment #8
tebb commentedThanks TAM Software,
I have applied the fix in #6 including enabling variable translation.
I can now list and edit menu entries, but I get the following notice when listing menu links:
Notice: Trying to get property of non-object in i18n_variable_initialize() (line 53 of /d7/sites/all/modules/i18n/i18n_variable/i18n_variable.module).
Looking at the variable translation configuration, I see that no variables are actually selected for translation. Should something be selected?
There is an entry in the variable translation list that says: Unknown variable unknown_variable We have no meta information for this variable. Please, ask module developers to declare their variables. See Variable module.
I guess this notice might be caused by another issue.
Comment #9
wvlgen commentedI have still the same problems after applying the patches in #6:
Fatal error: Call to undefined function _i18n_variable_initialize() in.../public_html/modules/translation_management/icl_content/icl_content.menus.inc on line 209
I have tried various combinations of the variables: all or some, but there is no difference.
Comment #10
tebb commented@wvlglen
You don't need the first '_'
It's just: i18n_variable_initialize
Comment #11
wvlgen commentedHello,
Thanks Dru-p: it works.
But I still get the following errors:
Notice: Trying to get property of non-object in i18n_variable_initialize() (line 53 of .../public_html/modules/i18n/i18n_variable/i18n_variable.module).
Notice: Trying to get property of non-object in i18n_variable_initialize() (line 54 of .../public_html/modules/i18n/i18n_variable/i18n_variable.module).
But at least I can continue to work.
Comment #12
tebb commented@wvlglen
I get the same 2 notices - see #8.
I do not have a solution for that yet.
Comment #13
david_de commentedThe solution in #8 seems to have solved all my menu problems. I was getting the errors on selecting menu edit in place of the edit page I had the error message.
Comment #14
haloola commentedsame as #11
Comment #15
scholli-d commentedI now use version 7.x-1.0-beta5 of i18n and installed the variable module (version 7.x-1.0), with this configuration the error does not occur. Now there are two messages left:
Comment #16
tebb commentedI am using the same versions mentioned by Scholli in #15, but I still get the notices for lines 53 and 54 shown in #11.
Comment #17
scholli-d commented#15 is not valid. I moved the i18n-module which did not work properly. Sorry for the wrong announcement!
Comment #18
kalmarr commentedI don't good idea:
I simple delete the code line
209 // $i18n_v_orig = i18n_variable_init($default->language);
If I make it I use the menu. I don't get error message.
I am waiting the fix it.
THX
KALMI
Comment #19
Stefan Haas commented+1
Comment #20
astutonetI also have the same erros. I'm also waiting a fix. Tks.
Comment #21
pedrojo commentedI had the same erros, but with the solution of #6 the problem of white-page when I like edit a menu didn´t have passed again. Certainly, the notices has gone, but for now has not affected the proper development of my site.
Comment #22
tamsoftware commentedAs promised, here's the patch file for #6
Franck Horlaville
TAM Software
Comment #23
jwilson3Patch in #22 works. Hoping to see this in beta2 soon ;)
Comment #24
jwilson3Upon closer investigation, i revoke my rtbc status... there are a few things wrong here:
1) At the very least, the patch needs to check to confirm the i18n_variable module exists before trying to use its functions. Eg:
2) i18n_variable_initialize() function doesn't return anything and hence this logic will never be true:
The initialize function is called by the i18n_variable modules hook_init function... this isn't what we need. I think the function we're looking for instead is
i18n_variable_load?Comment #25
jwilson3Here's a patch for #24.
Replaces _i18n_variables_init() with i18n_variable_load(), and checks to ensure i18n_variable module is enabled first.
Comment #26
gmetrail commentedPatch for #24 solves the problem on my server.
Comment #27
stefgosselin commented+1 for patch #25, it did the job nicely.
Comment #28
kurtzhong commentedPatch #25 rocks!!
Comment #29
jwilson3rtbc anyone?
Comment #30
miro_dietikerCurrently we're reimplementing this module from scratch in our codesprint:
http://drupalevents.ch/drupal/codesprint-2012
Thus all current bug reports and feature requests are dropped. Please recheck once the the sprint is completed.
Comment #31
Thanos Lappas commented#25 patch works fine
Comment #32
spyckedelic commentedI am having the same error, but I am fairly new to drupal and I am afraid to mess things up.
I haven't used patches before and it seems a quite complicated procedure.
Is there no easier way to fix this problem? :(
Comment #33
spyckedelic commentedWhen using patch from #25 I get this error:
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: icl_content/icl_content.module
|===================================================================
|--- icl_content/icl_content.module (revision 584)
Comment #34
spyckedelic commentedI fixed it!
I had to enter patch -p0 < (patch file) and then it worked!
Comment #35
Webmacahan commentedI´ve installed the patch and have verified the changes in the files, still getting the same error: "Fatal error: Call to undefined function _i18n_variable_initialize() in.../modules/translation_management/icl_content/icl_content.menus.inc on line 209".
I´ve uninstalled and re-installed all the relevant modules and have run the update script but nothing seems to help.
Any ideas?
Comment #36
ibarrajo commentedI've just encountered this error in Drupal 7.21 using Commerce Kickstart
It appears the devs in charge of internationalization have changed the name of the function in charge of initializing the variables from _i18n_variable_init() to i18n_variable_language_init()
Just go and change the lines to:
icl_content.menus.inc
209: $i18n_v_orig = i18n_variable_language_init($default->language);
219: $i18n_v_target = i18n_variable_language_init($lang->language);
and:
icl_content.module
2145: $i18n_v_orig = i18n_variable_language_init($original->language);
2146: $i18n_v_target = i18n_variable_language_init($code);
Comment #37
musa1234 commentedhi guys i manage to fix the issue for you
please paste this function under sites/all/modules/i18n/i18n_variable/i18n_variable.module ,it seems to be missing
Comment #38
fadyfawzey commentedHere is my solution Drupal Users , it solves all the problems to me :
Go to under sites/all/modules/translation_management/icl_content/icl_content.menus.inc ,
Go to the error line and change i18n_v_orig = _i18n_variable_init($default->language); to be $i18n_v_orig = i18n_variable_language_init($default->language);
Then watch the magic work :) ...
Hope that maintainer update his module to implement that .
Comment #39
tonybaldwin commentedI did that. It didn't help.
Just changes the error to
Fatal error: Call to undefined function _i18n_variable_initialize() in ../sites/all/modules/translation_management/icl_content/icl_content.menus.inc on line 209
Comment #40
GLinBoy commentedthanks ibarrajo,
Your solutionwork for me ;-)
I use Internationalization 7.x-1.8 on Drupal 7.22; my site languages is English (default) & Persian;