Home » Internationalization » Translation2 » Bug #2437
createNewLang Admin Container SQL
Details
| Submitted | 2004-10-02 04:08 UTC |
|---|---|
| From | agrenier at assertex dot com |
| Assigned | quipo |
| Status | Bogus |
| Package | Translation2 |
| PHP Version | 5.0.1 |
| OS | windows |
| Roadmaps | (Not assigned) |
Comments
[2004-10-02 04:08 UTC] agrenier at assertex dot com
Description:
------------
This is a bug occuring with createNewLang ...
It has been reported fixed in CVS, but I just looked at the code directly from the CVS and it's still there.
1 - Use of in_array on a multidimensional array (each row returned by a query in $res is an array)
2 - Tries to CREATE tables instead of ALTER.
3 - ALTER statement is missing col type
Reproduce code:
---------------
Admin/Container/mdb2.php (also affects db, mdb, etc)
Line 72 and 130:
if (in_array($this->options['strings_tables'][$langID], $res)) {
--> always false as $res is a multidimensional array.. fix:
$needle = array();
$needle[] = $this->options['strings_tables'][$langID];
if (in_array($needle, $res)) {
Line 78:
$query = sprintf('ALTER TABLE %s ADD COLUMN %s',
--> column type missing.. fix:
$query = sprintf('ALTER TABLE %s ADD COLUMN %s TEXT',
Expected result:
----------------
Tables should be created / altered automatically.
Actual result:
--------------
Adding new languages does not work.