Content Ratings

Content Ratings [Paid] 2.7.6

No permission to buy ($35.00)
Yeah we do. We have 15 or so reactions and they (now) have positive/negative scores.

The Reaction Score is still just showing the number of Likes though so something else must need rebuilding.
 
The Reaction Score is still just showing the number of Likes though so something else must need rebuilding.
I've identified & fixed the bug which caused this for the next version. It was the last step of the importer messing up :(

You just need to run the rebuild given/received reactions tasks to fix it
 
Any idea why reaction counts rebuild quickly but the given reaction counts is so slow? Is that a bug?

php cmd.php xf-rebuild:svcr-user-counts

Rebuilding... User reaction counts (509)
Rebuilding... User reaction counts (2822)
Rebuilding... User reaction counts (5128)
Rebuilding... User reaction counts (8327)
Rebuilding... User reaction counts (12288)
Rebuilding... User reaction counts (17025)
Rebuilding... User reaction counts (21978)
Rebuilding... User reaction counts (25571)
Rebuilding... User reaction counts (30552)
Rebuilding... User reaction counts (34109)

php cmd.php xf-rebuild:svcr-user-given-counts

Rebuilding... User given reaction counts (5)
Rebuilding... User given reaction counts (8)
Rebuilding... User given reaction counts (11)
 
Any idea why reaction counts rebuild quickly but the given reaction counts is so slow? Is that a bug?
Ah, There would be a missing an index;
SQL:
alter table xf_reaction_content add index reaction_user_id_reaction_date ('reaction_user_id','reaction_date');

The rebuild task looks to have had logic to add the index but it is disabled. Will fix that for the next version.
 
Do you have any plans to add the criteria based on nodes? Like user has recieved at least X likes in node Y? I've this idea for a long time now :D
Not currently planned, there really isn't any sane place to stick per-node reaction totals at the moment without more work.
 
Ah, There would be a missing an index;
SQL:
alter table xf_reaction_content add index reaction_user_id_reaction_date ('reaction_user_id','reaction_date');

The rebuild task looks to have had logic to add the index but it is disabled. Will fix that for the next version.

This happened as well:

Code:
Rebuilding... User given reaction counts (11558)

In AbstractStatement.php line 217:

  MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction


xf-rebuild:svcr-user-given-counts [--log-queries LOG-QUERIES] [-b|--batch BATCH] [--reaction_id REACTION_ID]

Exception query:

  UPDATE xf_user SET sv_sent_reactions = ? WHERE user_id = ?
 
Also when I try that SQL command I get:


SQL query:

alter table xf_reaction_content add index reaction_user_id_reaction_date ('reaction_user_id','reaction_date')

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''reaction_user_id','reaction_date')' at line 1
 
Xon updated Content Ratings for XF2.1+ with a new update entry:

2.0.6 - Bugfix/Maintenance update

  • Fix importer; Correctly extract Post Reaction rating names when displaying post ratings to map to existing reactions
  • Fix importer; Ensure reaction scores are imported from Post Rating category information
  • Fix rebuilding user given/received counts could result in reducing reaction counts
  • Ensure given reaction index on xf_reaction_content exists if the rebuild job is triggered (happens automatically on importing)
  • When rebuilding received reaction counts, also rebuild the...

Read the rest of this update entry...
 
I assume this is because the webserver user owns the templates?

Code:
Upgrading Content Ratings For XF2.1+ from 2.0.5 to 2.0.6...
Confirm upgrade? (y/n)y
Upgrading
Complete.

Importing add-on data
Importing... Add-on data (Class extensions)
Importing... Add-on data (Code events)
Importing... Add-on data (Code event listeners)
Importing... Add-on data (Content type fields)
Importing... Add-on data (Options)
Importing... Add-on data (Option groups)
Importing... Add-on data (Permissions)
Importing... Add-on data (Phrases)
Importing... Add-on data (Routes)
Importing... Add-on data (Style properties)
Importing... Add-on data (Style property groups)

In Local.php line 200:

  [ErrorException]
  [E_WARNING] file_put_contents(/home/sites/public_html/
  internal_data/code_cache/templates/l1/s0/admin/sv_contentratings_reaction_c
  ategory_delete.php): failed to open stream: Permission denied



xf:addon-sub-action [--k K] [--] <id> <action>


Running clean up tasks...

In Entity.php line 575:

  [LogicException]
  Attempted to set 'type' while a save was pending without forceSet
 
Did it via the ACP in the end and it seemed to go ok.

However, rebulding still doesn't update the score.

"When rebuilding received reaction counts, also rebuild the user's reaction score"
 
Top Bottom