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 #6233

calling Translation2_Admin::add() adds tranlslation twice

Details

Submitted2005-12-13 00:48 UTC
Frompowtac at gmx dot de
Assignedquipo
StatusClosed
PackageTranslation2
PHP Version5.1.0
OSWIN XP
Roadmaps(Not assigned)

Comments

[2005-12-13 00:48 UTC] powtac at gmx dot de

Description:
------------
I'm testing Translation2 for the first time. Perhaps I got some things wrong...

When I try to add an translation Translation2 adds this translation twice under different Ids. Like '1'(string) and 1(int).

(When I'm calling add one more time, Translation2 adds an other entry with Id '\'1\''(string)!)

I think the function is called internally twice. Or there is a problem when the Id is int. But then there should be an error msg.

Perhaps same problem here? http://pear.php.net/bugs/bug.php?id=2631&edit=2

Test script:
---------------
$driver = 'MDB';
require_once 'Translation2/Admin.php';
$tr = Translation2_Admin::factory($driver, $dbinfo, $params);
$tr->add(1, NULL, array('de' => 'Beispiel', 'en' => 'example'));

Expected result:
----------------
One entry in the DB, no error msg

page_id id en de
NULL 1 example Beispiel

Actual result:
--------------
Two (three) entrys in the DB, no error msg

page_id id en de
NULL 1 example Beispiel
NULL '1' example Beispiel

('NULL' '\'1\'' example Beispiel)