PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser » Bug #173

Chicken and Egg problem with addTranslation() and addLanguage()

Details

Submitted2003-10-31 15:07 UTC
Frommfriedman at symcor dot com
Assignedarnaud
StatusClosed
PackageLiveUser
PHP Version4.3.3
OSRedhat Linux
Roadmaps(Not assigned)

Comments

[2003-10-31 15:07 UTC] mfriedman at symcor dot com

Description:
------------
When you add the first language addTranslation() can't add the translation because the language doesn't exist yet. Also, addTranslation() returns boolean false when it cannot find the language but addLanguage() checks for a DB error to see if addTranslation() failed, not a boolean false. So, addTranslation() fails without alerting addLanguage(). That is, it fails silently.
As such the language table data is saved but the comment of the new language is lost and nothing is saved in the translation table.

Reproduce code:
---------------
This can be reproduced by starting with an empty live user database and using the DB admin complex api to add a new Language. Once you have added the new language, including the comment, check the database. You'll find that the comment was not saved in the translation table.

Expected result:
----------------
The comment should be saved in the translation table.