ElkArte Community

Project Support => Support => Topic started by: ladyquack on March 10, 2018, 05:35:16 pm

Title: Problem with likes
Post by: ladyquack on March 10, 2018, 05:35:16 pm
Hi there! I recently converted my forum from SMF to Elkarte (version 1.0.10 at the moment, but will be upgrading soon) and I've run into a bit of trouble with the Likes feature. When it's enabled and a user likes a post, it throws back the following error:

QuoteError in Likes

An Error Has Occurred : SyntaxError: JSON.parse: unexpected character at line 2 column 2 of the JSON data

What exactly would cause this problem? And how would one go about fixing it? Thanks in advance!
Title: Re: Problem with likes
Post by: emanuele on March 11, 2018, 01:39:28 am
Hi @ladyquack and welcome.

That problem coud be quite a bit of things.
Would you mind sending me address of the forum and the log in data ofa test account?
Title: Re: Problem with likes
Post by: ladyquack on March 11, 2018, 01:01:07 pm
Thanks!

And I’m sending that info to you now. 😀
Title: Re: Problem with likes
Post by: emanuele on March 11, 2018, 04:12:18 pm
hmm...
You have done some modifications to the code (for example I see you added a $codes = null in Subs.php to kill all the BBCodes, and just to mention, this is not really the best option, probably you should have just disabled the codes in the admin panel).
What other changes have you done?
Title: Re: Problem with likes
Post by: ladyquack on March 11, 2018, 04:21:04 pm
Those are the only changes I've made. I could try taking them out and seeing if that does anything.
Title: Re: Problem with likes
Post by: emanuele on March 11, 2018, 05:53:58 pm
That could be a start, at least it would be possible to clean up the error log and see if there is anything related to the likes. :)
Title: Re: Problem with likes
Post by: ladyquack on March 11, 2018, 07:05:02 pm
I cleaned up the files a little and that didn't do much.

However, I spotted a "likes" error in the error log pertaining to the database, so I checked it out. I installed a clean copy of the forum into a different directory to compare the databases, and it looks like the only difference between the two was that the cardinality in the "message_likes" structure on my forum was set to 1 for all. So I dropped the table and imported a fresh copy and now likes are working. xDD
Title: Re: Problem with likes
Post by: emanuele on March 11, 2018, 07:10:12 pm
hmm... okay... Dunno what happened.