PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Internationalization » Translation2 » Bug #2437

createNewLang Admin Container SQL

Details

Submitted2004-10-02 04:08 UTC
Fromagrenier at assertex dot com
Assignedquipo
StatusBogus
PackageTranslation2
PHP Version5.0.1
OSwindows
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.