The inline editor widget reports a JSON error when saving non-ASCII characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Launchpad itself |
High
|
Leonard Richardson | ||
| lazr.restful |
High
|
Leonard Richardson |
Bug Description
When saving a Bug title that contains unicode characters, using the Inline Editor widget, you receive the following error:
"Entity-body was not a well-formed JSON document."
The server returns a response code of 400, Bad Request.
At a glance, the JSON string being sent to the server appears to be well-formed, but this should be verified using the JSON parsers on both the client and server.
Related branches
Changed in launchpad-foundations: | |
assignee: | nobody → mars |
importance: | Undecided → High |
status: | New → Triaged |
summary: |
- The inline editor widget reports a JSON error when saving Unicode + The inline editor widget reports a JSON error when saving non-ASCII characters |
Philipp Kempgen (philipp-kempgen) wrote : | #1 |
Adi Roiban (adiroiban) wrote : | #2 |
maybe this bug is critical as with the new UI new user will not use the old „Update description / tags” link
Michael B. Trausch (mtrausch) wrote : | #3 |
I just tried this on bug 311908, where I went to use “Dock”, but had to type "dock" in order to get it to submit.
Changed in launchpad-foundations: | |
assignee: | Māris Fogels (mars) → Tom Berger (intellectronica) |
milestone: | none → 2.2.6 |
Māris Fogels (mars) wrote : | #4 |
Yes, this bug should be treated as critical, as it makes editing various titles impossible.
It is most likely a problem with the back-end webservice. JSON is unicode, there should not be a problem transmitting the data to and from the server.
Eleanor Berger (intellectronica) wrote : | #5 |
This is a bug in lazr.restful. I've got a fix for it
Changed in lazr.restful: | |
assignee: | nobody → Tom Berger (intellectronica) |
importance: | Undecided → High |
status: | New → In Progress |
Changed in launchpad-foundations: | |
status: | Triaged → In Progress |
Eleanor Berger (intellectronica) wrote : | #6 |
Fixed in lp:~launchpad-pqm/lazr.restful/trunk r27
Changed in lazr.restful: | |
status: | In Progress → Fix Committed |
Changed in launchpad-foundations: | |
status: | In Progress → Fix Committed |
Changed in lazr.restful: | |
status: | Fix Committed → Fix Released |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
Dmitry Agafonov (dmitry-agafonov) wrote : | #7 |
Not fixed (or re-appeared in new LP version).
Trying to edit bug description or assign it via ajax I'm getting error 400.
Eleanor Berger (intellectronica) wrote : | #8 |
Dmitry, can you please provide more information about the failure you're experiencing?
1. Is it plausibly due to non-ascii characters (that is, are there any non-ascii characters in the description)?
2. What bug are you trying to edit?
3. What browser are you using?
Dmitry Agafonov (dmitry-agafonov) wrote : | #9 |
1. Non-ascii characters are present.
2. https:/
3. Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.0.14) Gecko/2009090216 Ubuntu/8.04 (hardy) Firefox/3.0.14
Adi Roiban (adiroiban) wrote : | #10 |
I can confirm that this bug is not fixed in Launchpad 3.0 (r9636).
Just go to any bug title or description and try to add one of these characters „ș” or „ț”.
I hope that inline editor will allow all unicode characters.
Eleanor Berger (intellectronica) wrote : | #11 |
I can confirm that this fix isn't available in LP. We've switched to using a newer version of lazr.restful that doesn't have this fix as part of the move to buildout. To re-fix this bug we need to forward port this fix into the current lazr.restful and include an egg with these revisions for inclusion in LP.
Changed in launchpad-foundations: | |
status: | Fix Released → Triaged |
milestone: | 2.2.6 → none |
assignee: | Tom Berger (intellectronica) → nobody |
Changed in lazr.restful: | |
status: | Fix Released → Triaged |
assignee: | Tom Berger (intellectronica) → Leonard Richardson (leonardr) |
Changed in lazr.restful: | |
status: | Triaged → Fix Released |
Dmitry Agafonov (dmitry-agafonov) wrote : | #12 |
From #launchpad conversation:
- are there workarounds?
- For now, use the non-AJAX forms, add /+edit or /+editstatus to the bug URL.
Tormod Volden (tormodvolden) wrote : | #13 |
You can also right-click on the edit button and Open Link in New Tab.
Fix released? I just encountered the bug myself.
jpfle (jpfle) wrote : | #15 |
I confirm that the bug is still there. I've just encountered it for https:/
Māris Fogels (mars) wrote : | #16 |
@Chauncellor, it has been marked as "Fix Released" in the underlying lazr.restful library. It looks like the Foundations team still has to verify that the new lazr.restful has been pulled into the Launchpad source tree. If it has been pulled in then the fix should show up on edge.launchpad.net.
Leonard Richardson (leonardr) wrote : | #17 |
I've confirmed that the bug is gone in edge.launchpad.net, which uses the new library.
Diogo Matsubara (matsubara) wrote : | #18 |
Set foundations task as fix committed per r9689 <http://
Leonard tried to reproduce on edge and I tried on staging and both of us couldn't reproduce on those. Production will be updated in the next release.
Changed in launchpad-foundations: | |
status: | Triaged → Fix Committed |
assignee: | nobody → Leonard Richardson (leonardr) |
milestone: | none → 3.1.10 |
Changed in lazr.restful: | |
milestone: | none → 0.9.11 |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
Dmitry Agafonov (dmitry-agafonov) wrote : | #19 |
Not fixed, even on edge...
Dmitry Agafonov (dmitry-agafonov) wrote : | #20 |
Oh, sorry. Works for bug title and description inline editors.
Not fixed for "Assigned to..." ajax popup.
Here's roughly how to escape the string:
String. prototype. toJSON = function() /[\\"'\ x00-\x1F\ u0080-\ uFFFF]/ g, function(c) { 0).toString( 16)).slice( -4);
{
return '\''+ this.replace(
switch (c) {
case "\b": return '\\b';
case "\t": return '\\t';
case "\n": return '\\n';
case "\f": return '\\f';
case "\r": return '\\r';
case '"' : return '\\"';
case '\'': return '\\\'';
case '\\': return '\\\\';
}
return '\\u' + ('0000' + c.charCodeAt(
}) +'\'';
}