Adding languages problem :-(

Adding languages problem :-(

Postby karlos » Fri Feb 03, 2012 1:58 am

Hi - trying to add two new languages (ISO codes NL and DE). Language folders and file permissions set to 777. When trying to add them via the admin section I'm getting a: Fatal error: Call to undefined function sqlError() in /usr/home/barakaronda.com/web/availability-calendar/ac-admin/languages.admin.php on line 19

Any ideas?
karlos
 
Posts: 4
Joined: Fri Feb 03, 2012 1:50 am

Re: Adding languages problem :-(

Postby chris » Fri Feb 03, 2012 3:51 pm

Hi,
Opps, there is an error in the languages admin page. I wonder how that slipped through :(

Open ac-admin/languages.admin.php
Change line 19 from this:
Code: Select all
if (!$res_db = mysql_query($sql_db)) sqlError($sql_db,"DB TABLES");

to this:
Code: Select all
$res_db = mysql_query($sql_db) or die("error getting tables.<br>".mysql_error());


And, whilst you are in that file I have spotted the same error below.

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

to this:
Code: Select all
$res_table = mysql_query($sql_tables) or die("error getting columns.<br>".mysql_error());


And finally change line 47 from this:
Code: Select all
if(!mysql_query($add)) sqlError($add,"ADD LANG");

to this:
Code: Select all
mysql_query($add) or die("error adding language column.<br>".mysql_error());


Once you have made those changes you probably still won't be able to add the languages as those errors were php errors due to the code calling a function that no longer exists. However the reason that these lines were being called is actually due to a mysql error however the php error was preventing the mysql error from being shown.

Once you have made the changes let me know if you get a new error warning.

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

Re: Adding languages problem :-(

Postby karlos » Mon Feb 06, 2012 3:08 pm

Hi Chris - apologies for the delay making those changes - but I've done them now. You're right it's now throwing up a MySQL error as follows: error getting 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 '-calendar' at line 1
karlos
 
Posts: 4
Joined: Fri Feb 03, 2012 1:50 am

Re: Adding languages problem :-(

Postby karlos » Sat Feb 11, 2012 7:48 pm

Hi Chris - any thoughts? Karl
karlos
 
Posts: 4
Joined: Fri Feb 03, 2012 1:50 am

Re: Adding languages problem :-(

Postby chris » Sat Feb 18, 2012 3:56 pm

Hi, sorry, I missed your reply somehow.
The problem is possibly due to you apparently having a hyphen in your database name - this is normally not recommended.

In that same file, try changing this line (18):
Code: Select all
$sql_db="SHOW TABLES FROM ".AC_DB_NAME."";

to this:
Code: Select all
$sql_db="SHOW TABLES FROM `".AC_DB_NAME."`";


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

Re: Adding languages problem :-(

Postby karlos » Tue Feb 21, 2012 7:37 pm

Hi Chris - that worked perfectly. Good spot!
karlos
 
Posts: 4
Joined: Fri Feb 03, 2012 1:50 am


Return to Languages

Who is online

Users browsing this forum: No registered users and 2 guests

cron