db error occurs when adding already existing UI translation string

VERIFIED FIXED in 0.9.5

Status

VERIFIED FIXED
10 years ago
9 years ago

People

(Reporter: djst, Assigned: ecooper)

Tracking

unspecified
0.9.5

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: tiki_bug, tiki_upstreamed, URL)

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
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.
(Assignee)

Comment 1

10 years ago
I fixed this last night while taking a break from bug 481305.

It's in r22921/r22922.
(Assignee)

Updated

10 years ago
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Created attachment 365828 [details]
Post-fix screenshot

This shows "Add" and "whatever" as values.
Verified FIXED on https://support-stage.mozilla.org/tiki-edit_languages.php?locale=en-US.
Status: RESOLVED → VERIFIED
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.