davelester / WPBadger

A lightweight badge issuing platform built using WordPress
Other
43 stars 13 forks source link

Error when Accepting a Badge Award #32

Closed Zykez closed 11 years ago

Zykez commented 11 years ago

Maybe this is something you've covered already, but I received the following error when trying to add a new badge to my backpack as a test.

× We have encountered the following problem: trying to grab url http://zykez.com/awards/396971284924075/?json=1 got error ParseError: Failed to parse JSON at http://zykez.com/awards/396971284924075/?json=1: Unexpected token You didn't add any badges to your backpack.

davelester commented 11 years ago

I ran your assertion file through the Open Badges assertion validator, and the error is caused by your badge description. First of all, there is a badge description limit of 128 characters that you're surpassing.. I created an issue for this on the Open Badges project, but there hasn't been any follow-up. Secondly, you include newlines in your badge description. which is breaking when the JSON output is generated. I'll double-check that it's ok for me to represent newlines as \n in the JSON file, and if so add a patch to make it possible to include newlines.