HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
JSON Error with Vanilla 2.0.18.12
Anonymoose
✭✭
When posting a discussion, this appears:
Questions that may already have your answer:
parsererror (SyntaxError: JSON Parse error: Unrecognized token '<')
0
Comments
Temporary solution: Remove the related post functionality.
Replace contents of plugins/SphinxSearch/widgets/views/relatedpost.php
with:
you shouldn't end a php file with
?>
it is open to white space errors.grep is your friend.
Thanks. Fixed.
Better way to debug is figure out what you are getting back by looking the network traffic in inspect. That will tell you what you are getting instead of the JSON.
grep is your friend.
@Anonymoose Thanks for the bug report
I'm also seeing this in 2.1.11. As far as I can see, the cause is as follows.
A JS function,
waitForMsg()
, builds the URL to /plugin/sphinxsearch/newdiscussionThis function relies on a value from a DOM node,
$("#WebRoot").val()
.I don't appear to have that element in my DOM anywhere, and I'm guessing old mate up above has the same issue. The result is that the plugin attempts an AJAX call to
/undefined/plugin/sphinxsearch/newdiscussion
. This returns an HTML page and results in the '<' syntax error mentioned above.I think the correct way to do what you're trying to do is as follows:
Yes that was removed from the dom for security reasons.
Your function is correct usage. For general definitions use
gdn.definition
grep is your friend.
Hi, when i create a new discussion, i still get this:
How to fix that?