Closed Bug 462507 Opened 16 years ago Closed 15 years ago

db error occurs when adding already existing UI translation string

Categories

(support.mozilla.org :: Localization, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: djst, Assigned: ecooper)

References

()

Details

(Whiteboard: tiki_bug, tiki_upstreamed)

Attachments

(1 file)

A db error occurs if you try to add a new translation string that already exists. 

1. Go to http://support.mozilla.com/tiki-edit_languages.php?locale=en-US
2. Select the fy-NL locale and select "Add a new translation (if you cannot find an existing translation to edit)"
3. Click "Edit language table"
4. in Original, type "Add", and in Translation type "whatever"
5. Click Add
6. Enjoy this error:

An error occured in a database query!<span onclick="window.open('tiki-interactive_trans.php?content=An+error+occured+in+a+database+query%21','traduction','toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,width=600,height=300,left=10,top=10');return false;">°</span>
44:15
Context:
File    tiki-edit_languages.php
Url    tiki-edit_languages.php?locale=fy-NL
Query:
insert into `tiki_language` values (?,?,?)
Values:
0    Add
1    fy-NL
2    whatever
Message:
Duplicate entry 'Add-fy-NL' for key 1
Built query was probably:
insert into `tiki_language` values ('Add','fy-NL','whatever')



A much neater solution would be to just update the existing string instead of throwing a scary db error message.
I fixed this last night while taking a break from bug 481305.

It's in r22921/r22922.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Attached image Post-fix screenshot
This shows "Add" and "whatever" as values.
Whiteboard: tiki_bug
Whiteboard: tiki_bug → tiki_bug, tiki_fixed
Whiteboard: tiki_bug, tiki_fixed → tiki_bug, tiki_upstreamed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: