Content Ratings

Content Ratings [Paid] 2.8.1

No permission to buy ($35.00)
Hey @Xon getting these errors recently not sure what is going on!

Code:
XF\Db\InvalidQueryException: MySQL statement prepare error [3143]: Invalid JSON path expression. The error is around character position 3. src/XF/Db/AbstractStatement.php:230
Generated by:  Sep 16, 2023 at 9:19 PM
Stack trace
                    UPDATE xf_user
                    SET sv_sent_reactions = JSON_SET(coalesce(sv_sent_reactions, '{}'), '$.1', greatest(0, coalesce(JSON_VALUE(coalesce(sv_sent_reactions, '{}'), '$.1'), 0) + 1) )
                    WHERE user_id = ?
                
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 3143, '42000')
#1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 3143, '42000')
#2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(773): XF\Db\AbstractAdapter->query('
              ...', Array)
#5 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(108): SV\ContentRatings\XF\Repository\Reaction->svUpdateUserReactions(31770, Array, true)
#6 src/XF/Entity/ReactionContent.php(117): SV\ContentRatings\XF\Entity\ReactionContent->adjustUserReactionScore(43354, 0)
#7 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(180): XF\Entity\ReactionContent->_postSave()
#8 src/XF/Mvc/Entity/Entity.php(1277): SV\ContentRatings\XF\Entity\ReactionContent->_postSave()
#9 src/XF/Repository/Reaction.php(191): XF\Mvc\Entity\Entity->save()
#10 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(1006): XF\Repository\Reaction->insertReaction(1, 'post', 5307566, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#11 src/XF/Repository/Reaction.php(144): SV\ContentRatings\XF\Repository\Reaction->insertReaction(1, 'post', 5307566, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#12 src/XF/ControllerPlugin/Reaction.php(67): XF\Repository\Reaction->reactToContent(1, 'post', 5307566, Object(SV\SearchImprovements\XF\Entity\User), true)
#13 src/XF/ControllerPlugin/Reaction.php(21): XF\ControllerPlugin\Reaction->actionToggleReaction(Object(SV\WarningImprovements\XF\Entity\Post), 'posts/reactions', 'posts')
#14 src/XF/ControllerPlugin/Reaction.php(14): XF\ControllerPlugin\Reaction->actionReact(Object(SV\WarningImprovements\XF\Entity\Post), 'posts', 'posts/react', 'posts/reactions')
#15 src/XF/Pub/Controller/Post.php(381): XF\ControllerPlugin\Reaction->actionReactSimple(Object(SV\WarningImprovements\XF\Entity\Post), 'posts')
#16 src/addons/KL/EditorManager/XF/Pub/Controller/Post.php(30): XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#17 src/XF/Mvc/Dispatcher.php(352): KL\EditorManager\XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'React', Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#22 src/XF.php(524): XF\App->run()
#23 index.php(20): XF::runApp('XF\\Pub\\App')
#24 {main}


Code:
XF\Db\InvalidQueryException: MySQL statement prepare error [3143]: Invalid JSON path expression. The error is around character position 4. src/XF/Db/AbstractStatement.php:230
Generated by:  Sep 16, 2023 at 9:11 PM
Stack trace
                    UPDATE xf_user
                    SET sv_sent_reactions = JSON_SET(coalesce(sv_sent_reactions, '{}'), '$.24', greatest(0, coalesce(JSON_VALUE(coalesce(sv_sent_reactions, '{}'), '$.24'), 0) + 1) )
                    WHERE user_id = ?
                
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 3143, '42000')
#1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 3143, '42000')
#2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(773): XF\Db\AbstractAdapter->query('
              ...', Array)
#5 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(108): SV\ContentRatings\XF\Repository\Reaction->svUpdateUserReactions(8209, Array, true)
#6 src/XF/Entity/ReactionContent.php(117): SV\ContentRatings\XF\Entity\ReactionContent->adjustUserReactionScore(48936, 0)
#7 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(180): XF\Entity\ReactionContent->_postSave()
#8 src/XF/Mvc/Entity/Entity.php(1277): SV\ContentRatings\XF\Entity\ReactionContent->_postSave()
#9 src/XF/Repository/Reaction.php(191): XF\Mvc\Entity\Entity->save()
#10 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(1006): XF\Repository\Reaction->insertReaction(24, 'post', 5307478, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#11 src/XF/Repository/Reaction.php(144): SV\ContentRatings\XF\Repository\Reaction->insertReaction(24, 'post', 5307478, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#12 src/XF/ControllerPlugin/Reaction.php(67): XF\Repository\Reaction->reactToContent(24, 'post', 5307478, Object(SV\SearchImprovements\XF\Entity\User), true)
#13 src/XF/ControllerPlugin/Reaction.php(21): XF\ControllerPlugin\Reaction->actionToggleReaction(Object(SV\WarningImprovements\XF\Entity\Post), 'posts/reactions', 'posts')
#14 src/XF/ControllerPlugin/Reaction.php(14): XF\ControllerPlugin\Reaction->actionReact(Object(SV\WarningImprovements\XF\Entity\Post), 'posts', 'posts/react', 'posts/reactions')
#15 src/XF/Pub/Controller/Post.php(381): XF\ControllerPlugin\Reaction->actionReactSimple(Object(SV\WarningImprovements\XF\Entity\Post), 'posts')
#16 src/addons/KL/EditorManager/XF/Pub/Controller/Post.php(30): XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#17 src/XF/Mvc/Dispatcher.php(352): KL\EditorManager\XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'React', Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#22 src/XF.php(524): XF\App->run()
#23 index.php(20): XF::runApp('XF\\Pub\\App')
 
Hey @Xon getting these errors recently not sure what is going on!

Code:
XF\Db\InvalidQueryException: MySQL statement prepare error [3143]: Invalid JSON path expression. The error is around character position 3. src/XF/Db/AbstractStatement.php:230
Generated by:  Sep 16, 2023 at 9:19 PM
Stack trace
                    UPDATE xf_user
                    SET sv_sent_reactions = JSON_SET(coalesce(sv_sent_reactions, '{}'), '$.1', greatest(0, coalesce(JSON_VALUE(coalesce(sv_sent_reactions, '{}'), '$.1'), 0) + 1) )
                    WHERE user_id = ?
              
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 3143, '42000')
#1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 3143, '42000')
#2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(773): XF\Db\AbstractAdapter->query('
              ...', Array)
#5 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(108): SV\ContentRatings\XF\Repository\Reaction->svUpdateUserReactions(31770, Array, true)
#6 src/XF/Entity/ReactionContent.php(117): SV\ContentRatings\XF\Entity\ReactionContent->adjustUserReactionScore(43354, 0)
#7 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(180): XF\Entity\ReactionContent->_postSave()
#8 src/XF/Mvc/Entity/Entity.php(1277): SV\ContentRatings\XF\Entity\ReactionContent->_postSave()
#9 src/XF/Repository/Reaction.php(191): XF\Mvc\Entity\Entity->save()
#10 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(1006): XF\Repository\Reaction->insertReaction(1, 'post', 5307566, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#11 src/XF/Repository/Reaction.php(144): SV\ContentRatings\XF\Repository\Reaction->insertReaction(1, 'post', 5307566, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#12 src/XF/ControllerPlugin/Reaction.php(67): XF\Repository\Reaction->reactToContent(1, 'post', 5307566, Object(SV\SearchImprovements\XF\Entity\User), true)
#13 src/XF/ControllerPlugin/Reaction.php(21): XF\ControllerPlugin\Reaction->actionToggleReaction(Object(SV\WarningImprovements\XF\Entity\Post), 'posts/reactions', 'posts')
#14 src/XF/ControllerPlugin/Reaction.php(14): XF\ControllerPlugin\Reaction->actionReact(Object(SV\WarningImprovements\XF\Entity\Post), 'posts', 'posts/react', 'posts/reactions')
#15 src/XF/Pub/Controller/Post.php(381): XF\ControllerPlugin\Reaction->actionReactSimple(Object(SV\WarningImprovements\XF\Entity\Post), 'posts')
#16 src/addons/KL/EditorManager/XF/Pub/Controller/Post.php(30): XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#17 src/XF/Mvc/Dispatcher.php(352): KL\EditorManager\XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'React', Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#22 src/XF.php(524): XF\App->run()
#23 index.php(20): XF::runApp('XF\\Pub\\App')
#24 {main}


Code:
XF\Db\InvalidQueryException: MySQL statement prepare error [3143]: Invalid JSON path expression. The error is around character position 4. src/XF/Db/AbstractStatement.php:230
Generated by:  Sep 16, 2023 at 9:11 PM
Stack trace
                    UPDATE xf_user
                    SET sv_sent_reactions = JSON_SET(coalesce(sv_sent_reactions, '{}'), '$.24', greatest(0, coalesce(JSON_VALUE(coalesce(sv_sent_reactions, '{}'), '$.24'), 0) + 1) )
                    WHERE user_id = ?
              
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 3143, '42000')
#1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 3143, '42000')
#2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(773): XF\Db\AbstractAdapter->query('
              ...', Array)
#5 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(108): SV\ContentRatings\XF\Repository\Reaction->svUpdateUserReactions(8209, Array, true)
#6 src/XF/Entity/ReactionContent.php(117): SV\ContentRatings\XF\Entity\ReactionContent->adjustUserReactionScore(48936, 0)
#7 src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php(180): XF\Entity\ReactionContent->_postSave()
#8 src/XF/Mvc/Entity/Entity.php(1277): SV\ContentRatings\XF\Entity\ReactionContent->_postSave()
#9 src/XF/Repository/Reaction.php(191): XF\Mvc\Entity\Entity->save()
#10 src/addons/SV/ContentRatings/XF/Repository/Reaction.php(1006): XF\Repository\Reaction->insertReaction(24, 'post', 5307478, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#11 src/XF/Repository/Reaction.php(144): SV\ContentRatings\XF\Repository\Reaction->insertReaction(24, 'post', 5307478, Object(SV\SearchImprovements\XF\Entity\User), true, false)
#12 src/XF/ControllerPlugin/Reaction.php(67): XF\Repository\Reaction->reactToContent(24, 'post', 5307478, Object(SV\SearchImprovements\XF\Entity\User), true)
#13 src/XF/ControllerPlugin/Reaction.php(21): XF\ControllerPlugin\Reaction->actionToggleReaction(Object(SV\WarningImprovements\XF\Entity\Post), 'posts/reactions', 'posts')
#14 src/XF/ControllerPlugin/Reaction.php(14): XF\ControllerPlugin\Reaction->actionReact(Object(SV\WarningImprovements\XF\Entity\Post), 'posts', 'posts/react', 'posts/reactions')
#15 src/XF/Pub/Controller/Post.php(381): XF\ControllerPlugin\Reaction->actionReactSimple(Object(SV\WarningImprovements\XF\Entity\Post), 'posts')
#16 src/addons/KL/EditorManager/XF/Pub/Controller/Post.php(30): XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#17 src/XF/Mvc/Dispatcher.php(352): KL\EditorManager\XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'React', Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(LiamW\MentionMiniAvatar\XF\Pub\Controller\Post), NULL)
#20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#22 src/XF.php(524): XF\App->run()
#23 index.php(20): XF::runApp('XF\\Pub\\App')

this happened after migration to AlmaLinux v8 mysql 8.
 
Last edited:
this happened after migration to AlmaLinux v8 mysql 8.
You'll need to set the site into debug mode (in config.php; $config['debug'] = 1;), and change the option svContentRatingJsonDb from MariaDB to MySQL. And if that doesn't work, try "off"

Frustratingly json support is quite different between mysql vs mariadb
 
Last edited:
"off" seems to work now but not mysql

Code:
XF\Db\Exception: MySQL query error [3144]: Cannot create a JSON value from a string with CHARACTER SET 'binary'. in src/XF/Db/AbstractStatement.php at line 230
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 198
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 79
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 96
XF\Db\AbstractAdapter->query() in src/addons/SV/ContentRatings/XF/Repository/Reaction.php at line 773
SV\ContentRatings\XF\Repository\Reaction->svUpdateUserReactions() in src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php at line 108
SV\ContentRatings\XF\Entity\ReactionContent->adjustUserReactionScore() in src/XF/Entity/ReactionContent.php at line 117
XF\Entity\ReactionContent->_postSave() in src/addons/SV/ContentRatings/XF/Entity/ReactionContent.php at line 180
SV\ContentRatings\XF\Entity\ReactionContent->_postSave() in src/XF/Mvc/Entity/Entity.php at line 1277
XF\Mvc\Entity\Entity->save() in src/XF/Repository/Reaction.php at line 191
XF\Repository\Reaction->insertReaction() in src/addons/SV/ContentRatings/XF/Repository/Reaction.php at line 1006
SV\ContentRatings\XF\Repository\Reaction->insertReaction() in src/XF/Repository/Reaction.php at line 144
XF\Repository\Reaction->reactToContent() in src/XF/ControllerPlugin/Reaction.php at line 67
XF\ControllerPlugin\Reaction->actionToggleReaction() in src/XF/ControllerPlugin/Reaction.php at line 21
XF\ControllerPlugin\Reaction->actionReact() in src/XF/ControllerPlugin/Reaction.php at line 14
XF\ControllerPlugin\Reaction->actionReactSimple() in src/XF/Pub/Controller/Post.php at line 381
XF\Pub\Controller\Post->actionReact() in src/addons/KL/EditorManager/XF/Pub/Controller/Post.php at line 30
KL\EditorManager\XF\Pub\Controller\Post->actionReact() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2487
XF\App->run() in src/XF.php at line 524
XF::runApp() in index.php at line 20
 
Yuck. I'll need to install MySQL8 and test against it at some point

Make sure to disable debug mode once you are done.
 
  • Like
Reactions: KSA
Trying to move away from all Themehouse add-ons and switched to this today and was surprised to see that while reactions can be limited to user groups, I cannot assign them to a specific user. It would be very cool to have the option to assign a reaction to a specific user, as this is a perk we like to offer to our most active members (custom reactions)!
 
Trying to move away from all Themehouse add-ons and switched to this today and was surprised to see that while reactions can be limited to user groups, I cannot assign them to a specific user. It would be very cool to have the option to assign a reaction to a specific user, as this is a perk we like to offer to our most active members (custom reactions)!

You can actually can through the restrictions tab

Screenshot_20230927_113642_Samsung Internet.webp
 
I think you may have misread, my hope is to not limit by user group but be able to limit to a specific user so only they can use it :)

Your only work around is to add those users whom you whish to grant/limit to a secondary usergroup and set the "can react" permission to either Yes/Never and let them inhert the rest of the permission from their primary usergroup.
 
Trying to move away from all Themehouse add-ons and switched to this today and was surprised to see that while reactions can be limited to user groups, I cannot assign them to a specific user. It would be very cool to have the option to assign a reaction to a specific user, as this is a perk we like to offer to our most active members (custom reactions)!
Apologies, I just noticed I actually had implemented allow/deny by user and also allow/deny by thread but just never released it.

1695796260627.webp
 
that's amazing, thank you so much!!

another question:

does this addon respect Alerts Summarization preferences from your addon Alert Improvements? it hasn't been summarizing content Ratings on my website so I Just want to confirm it's as intended and not a bug or something I've configured poorly on my end.
 
that's amazing, thank you so much!!

another question:

does this addon respect Alerts Summarization preferences from your addon Alert Improvements? it hasn't been summarizing content Ratings on my website so I Just want to confirm it's as intended and not a bug or something I've configured poorly on my end.
It does, however it only does the summarization when you open the alert pop-up, and only for unread alerts. If you view the content it marks the alert as read, so it isn't a candidate to be summarized.
 
Apologies, I just noticed I actually had implemented allow/deny by user and also allow/deny by thread but just never released it.

View attachment 291663


can we have this deny/allow controlled from the front-end? this will help especially for admins/mods to easy access this feature. it will make a lot of difference. Thank you Xon!
 
can we have this deny/allow controlled from the front-end? this will help especially for admins/mods to easy access this feature. it will make a lot of difference. Thank you Xon!
My (paid) Post Fiction add-on already allows per-thread allow/deny reactions (the allow parts is a little wonky).

But the entire restrictions UI? That is quite a bit more difficult on where the heck would you put it?
 
Back
Top Bottom