Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.4

Bug #11482 Call of addLang with existing languages with MDB2 results in error
Submitted: 2007-06-29 22:04 UTC Modified: 2007-06-30 10:40 UTC
From: cms Assigned: quipo
Status: Closed Package: Translation2 (version 2.0.0beta12)
PHP Version: 5.2.1 OS: Linux 2.6.20
Roadmaps: (Not assigned)    
Subscription  


 [2007-06-29 22:04 UTC] cms (Carl Michael Skog)
Description: ------------ Trying to add languages with Translation2_Admin::addLang() results in error IFF there already exists languages result in an 'Already exists' error. Adding a 'return true' just before fall-off in the 'if (in_array()' if statement will fix the bug. Expected result: ---------------- true as return value Actual result: -------------- Error value

Comments

 [2007-06-29 22:14 UTC] cms (Carl Michael Skog)
The if statement I am referring to is in the class Translation2_Admin_Container_mdb2.
 [2007-06-30 04:19 UTC] quipo (Lorenzo Alberton)
Sorry, why is this a bug? If you're trying to add a language which already exists, then getting an "Already exists" error is exactly what I'd expect... Or maybe I didn't understand your problem?
 [2007-06-30 10:04 UTC] cms (Carl Michael Skog)
Where did I say that the new language to be added is already added ? You get that error if ANY language at all has been added before. The problem is that, even though, the code correctly identifies when it has to alter the table, execution still continues to the creation of the table, which, of course, results in a SQL error 'table already exists'.
 [2007-06-30 10:40 UTC] quipo (Lorenzo Alberton)
Oh, sorry, I hadn't fully understood what you said in the first comment. Fixed in CVS :-)