Read the statement by Michael Teeuw here.
Some sort of JSON interpretation problem in newsfeed module
-
I’ve been struggling with an external compliments file for some time, and after another user posted his on gist, I took the liberty to use that as a test, and then compared the two.
I couldn’t get mine to work at all, but the other worked fine.
By changing the indentation to three spaces, it worked. It was two spaces.
This is a really odd problem, there is no standard to my knowledge for JSON that sets it at specific three spaces?So this didn’t work:
{ "anytime" : [ "Jeg beundrer,\nat du altid er helt dig selv", "Man bliver så glad af\nat være sammen med dig", ...But this does
{ "anytime" : [ "Jeg beundrer,\nat du altid er helt dig selv", "Man bliver så glad af\nat være sammen med dig", ...I think that is really odd.
Furthermore I had to remember the quotes around the key, which isn’t needed in the internal list, but if I read it right, it must have quotes in a proper json file.
-
@fribse all things must be quoted in json, JavaScript only the right side of : needs quoting
I use an online JSON validator to check my JSON files. this is my go-to
https://codebeautify.org/jsonvalidator?/jsonvalidate
click the top left corner and it will format the content. great for understanding API returnsI have never seen spaces make a difference
maybe there is a tab in there?
-
@fribse u could also copy the default from the doc, or the module source too
-
@sdetweil Hey Sam
I only wrote the thing with the quotes as the internal config seems to be a bit more leniant.
No tabs, the ONLY thing I did to make it work, was add an extra space :-)
My config is so old by now, that every time I look at it, I have to rethink everything to get to the same result :-D -
@fribse if u run it thru the validator, does it work?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login