Issue Details (XML | Word | Printable)

Key: CHEF-659
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adam Jacob
Reporter: Bryan McLellan
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Chef

UI expands some escaped characters from JSON, then fails to encode them again

Created: 29/Oct/09 10:48 PM   Updated: 22/Dec/09 10:53 PM   Resolved: 22/Dec/09 10:53 PM
Component/s: Chef Server
Affects Version/s: 0.7.12
Fix Version/s: 0.8.2


 Description  « Hide

If the JSON contains a tab character escaped as '\t' or escaped as unicode, the jsoneditor expands it, then fails to encode it again when it saves the json, which then gets rejected by JSON.parse.

See CHEF-634 for more information.



Sort Order: Ascending order - Click to sort in descending order
Peter Crossley added a comment - 30/Oct/09 11:15 PM - edited

Also just having an attribute like:

"users" : [
"ABC
user1",
"ABC
user2"
]

after saving, and then going back to the editor, the array now looks like:

"users" : [
"ABCuser1",
"ABCuser2"
]

side note: when using the editor you need to double escape but via a attributes.rb file single escape works. Making me believe its a pure UI issue.


Peter Crossley added a comment - 30/Oct/09 11:51 PM - edited

After fighting with this and needing to use futon to update the attributes I would suggest that this needs to be increased in severity since every time you save the node a level of escaped characters gets stripped from the JSON.


Adam Jacob added a comment - 02/Nov/09 07:20 PM

Bumping the severity to Major, setting for 0.8.0


Peter Crossley added a comment - 04/Nov/09 10:58 AM

This fix was forked from 7.14, I would be interested in seeing if a patch might be in order for 0.7.14 or another release.

http://github.com/pcross616/chef/tree/CHEF-659

I will also create a 0.8.0 branch with this new code... just not tonight.


Peter Crossley added a comment - 06/Nov/09 06:18 AM

OK..

http://github.com/pcross616/chef/tree/CHEF-659 is updated with the final 0.7.14 patch

I will integrate to 0.8 now and push to a new branch on git hub.


Peter Crossley added a comment - 06/Nov/09 09:28 AM

OK, 0.8 version of the new json editor is now up on github. I was using our dev-chef box and checked in as btm, but its all in there.

http://github.com/pcross616/chef/tree/CHEF-659-ALPHA

Let me know if you see any issues.


Peter Crossley added a comment - 06/Nov/09 11:57 AM

Fixed in both code bases 0.7.14 and 0.8.0, recommend for 0.7.16

see git repo's for history and cherry-pick commits.


Adam Jacob added a comment - 10/Nov/09 02:48 AM

This is in the Chef 0.8.0 Branch now, Pete. Thanks!

I found a couple of issues, but in general it's so much nicer that it's merged.

Thanks for the effort - it rocks.


Bryan McLellan added a comment - 24/Nov/09 06:34 AM

not fixed 0.7.14, editing issue.


Bryan McLellan added a comment - 24/Nov/09 06:35 AM

Setting fix version to 0.7.16 (unreleased) and 0.8.0 (unreleased)