Error when adding new language

Help with installation and general calendar setttings

Error when adding new language

Postby madu » Wed Jun 30, 2010 12:00 am

Hi

I just installed AC and wanted to make it display in german.
As stated, I chmod the language-files and directory 777.
Then I tried to add a new language (de) in admin section.
I got following error:
Fatal error: Call to undefined function sqlerror() in /home/httpd/vhosts/mydomain.xx/httpdocs/cal/ac-admin/languages.admin.php on line 19

I later tried manually by duplicating the english language-file and rename it to de.lang.php.
I can now see an de-language in admin and I can make it default in settings but nothing does display in german.

Any help?


/edit:
strange...
just for testing I changed default language to spanish, but still everything is displayed in english... :?

edit: ok, loging out and in again solved this and I read spanisch now
Last edited by madu on Wed Jun 30, 2010 12:13 am, edited 1 time in total.
madu
 
Posts: 3
Joined: Tue Jun 29, 2010 11:24 pm

Re: Error when adding new language

Postby chris » Wed Jun 30, 2010 12:11 am

Hi,
Fatal error: Call to undefined function sqlerror() in /home/httpd/vhosts/mydomain.xx/httpdocs/cal/ac-admin/languages.admin.php on line 19

hmmm the sqlerror() funciton is an old function that this script doesn't use... I wonder how that got in there and it's strange that it has come up before.

In the languages.admin.php file, replace the following:
Line 19:
Code: Select all
if (!$res_db = mysql_query($sql_db)) sqlError($sql_db,"DB TABLES");

with:
Code: Select all
if (!$res_db = mysql_query($sql_db)) die("error reading tables<br>".mysql_error()."<br>".$sql_db);

line 25:
Code: Select all
if (!$res_table = mysql_query($sql_tables)) sqlError($sql_tables,"TABLE FIELDS");

with:
Code: Select all
if (!$res_table = mysql_query($sql_tables)) die("error reading fields<br>".mysql_error()."<br>".$sql_tables);

Line 47:
Code: Select all
if(!mysql_query($add)) sqlError($add,"ADD LANG");

with:
[code]if(!mysql_query($add)) die("error adding_lang<br>".mysql_error()."<br>".$add);

This won't actually solve your problem but hopefully it should now allow the script to run and give you some meaningful error messages.

When you have made those changes, run the file again via admin and get back to me with the new error warning - for some reason you are not able to read the tables :(

As regards adding the file manually in the ftp, as you will have seen this doesn't work as the database also needs to be modified. I will be adressing this issue in the next release which will include a complete rewrite of how the languages are administerd (not that that is much help to you now)

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Error when adding new language

Postby madu » Wed Jun 30, 2010 12:37 am

wow - quick response 8-)

ok, made the changes
error now says:
Code: Select all
error reading tables
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-ac' at line 1
SHOW TABLES FROM stb-ac


Obviously, SQL does not like the "-" in the database-name "stb-ac" (did't know that).
I made a new database with different name, run the installer again and now it seems to work :)
madu
 
Posts: 3
Joined: Tue Jun 29, 2010 11:24 pm

Re: Error when adding new language

Postby chris » Wed Jun 30, 2010 12:42 am

Obviously, SQL does not like the "-" in the database-name "stb-ac" (did't know that).
I made a new database with different name, run the installer again and now it seems to work

Yes, *some* servers don't like hyphens in database names. There is a workround for this but you have solved it the "simple" way by changing the databsase name :)

Glad to be able to help.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron