XF 2.1 Reactions/Cache

Brandon K

Active member
Hello,

I recently upgraded to 2.1 on a test site and after running a rebuild threads tool I get this:

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'reaction_score' in 'field list' in src/XF/Db/AbstractStatement.php at line 217
  1. XF\Db\AbstractStatement->getException() insrc/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() insrc/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.phpat line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.phpat line 94
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 145
  6. XF\Db\AbstractAdapter->fetchRow() in src/XF/Entity/Thread.php at line602
  7. XF\Entity\Thread->rebuildFirstPostInfo() in src/XF/Entity/Thread.php at line 587
  8. XF\Entity\Thread->rebuildCounters() in src/XF/Job/Thread.php at line 36
  9. XF\Job\Thread->rebuildById() in src/XF/Job/AbstractRebuildJob.php at line 47
  10. XF\Job\AbstractRebuildJob->run() in src/XF/Job/Manager.php at line253
  11. XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line195
  12. XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 111
  13. XF\Job\Manager->runByIds() in src/XF/Admin/Controller/Tools.php at line 120
  14. XF\Admin\Controller\Tools->actionRunJob() insrc/XF/Mvc/Dispatcher.php at line 321
  15. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line248
  16. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.phpat line 100
  17. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line50
  18. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
  19. XF\App->run() in src/XF.php at line 390
  20. XF::runApp() in admin.php at line 13
I also get this when I attempt to like or react to a post:

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'reaction_score' in 'field list' in src/XF/Db/AbstractStatement.php at line 217
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 326
  6. XF\Db\AbstractAdapter->update() in src/XF/Mvc/Entity/Entity.php at line 1457
  7. XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1184
  8. XF\Mvc\Entity\Entity->save() in src/XF/Reaction/AbstractHandler.php at line 107
  9. XF\Reaction\AbstractHandler->updateContentReactions() in src/XF/Repository/Reaction.php at line 269
  10. XF\Repository\Reaction->rebuildContentReactionCache() in src/XF/Entity/ReactionContent.php at line 198
  11. XF\Entity\ReactionContent->rebuildContentReactionCache() in src/XF/Entity/ReactionContent.php at line 140
  12. XF\Entity\ReactionContent->_postSave() in src/XF/Mvc/Entity/Entity.php at line 1208
  13. XF\Mvc\Entity\Entity->save() in src/XF/Repository/Reaction.php at line 184
  14. XF\Repository\Reaction->insertReaction() in src/XF/Repository/Reaction.php at line 137
  15. XF\Repository\Reaction->reactToContent() in src/XF/ControllerPlugin/Reaction.php at line 65
  16. XF\ControllerPlugin\Reaction->actionToggleReaction() in src/XF/ControllerPlugin/Reaction.php at line 19
  17. XF\ControllerPlugin\Reaction->actionReact() in src/XF/ControllerPlugin/Reaction.php at line 12
  18. XF\ControllerPlugin\Reaction->actionReactSimple() in src/XF/Pub/Controller/Post.php at line 368
  19. XF\Pub\Controller\Post->actionReact() in src/XF/Mvc/Dispatcher.php at line 321
  20. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
  21. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
  22. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
  23. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
  24. XF\App->run() in src/XF.php at line 390
  25. XF::runApp() in index.php at line 20
Both mention the reaction_score so I assume it's related. Any help would be appreciated.
 
That's a new table/column in 2.1, to reflect the change from likes to reactions.

It's possible one of the queries failed to execute when upgrading to 2.1.

Can you show the xf_user table structure from phpMyAdmin?
SQL:
SHOW CREATE TABLE xf_user;
 
That's a new table/column in 2.1, to reflect the change from likes to reactions.

It's possible one of the queries failed to execute when upgrading to 2.1.

Can you show the xf_user table structure from phpMyAdmin?
SQL:
SHOW CREATE TABLE xf_user;
CREATE TABLE xf_user (
user_id int(10) unsigned NOT NULL AUTO_INCREMENT,
username varchar(50) NOT NULL,
email varchar(120) NOT NULL,
custom_title varchar(50) NOT NULL DEFAULT '',
language_id int(10) unsigned NOT NULL,
style_id int(10) unsigned NOT NULL COMMENT '0 = use system default',
timezone varchar(50) NOT NULL COMMENT 'Example: ''Europe/London''',
visible tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT 'Show browsing activity to others',
user_group_id int(10) unsigned NOT NULL,
secondary_group_ids varbinary(255) NOT NULL,
display_style_group_id int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'User group ID that provides user styling',
permission_combination_id int(10) unsigned NOT NULL,
message_count int(10) unsigned NOT NULL DEFAULT '0',
conversations_unread smallint(5) unsigned NOT NULL DEFAULT '0',
register_date int(10) unsigned NOT NULL DEFAULT '0',
last_activity int(10) unsigned NOT NULL DEFAULT '0',
trophy_points int(10) unsigned NOT NULL DEFAULT '0',
alerts_unread smallint(5) unsigned NOT NULL DEFAULT '0',
avatar_date int(10) unsigned NOT NULL DEFAULT '0',
avatar_width smallint(5) unsigned NOT NULL DEFAULT '0',
avatar_height smallint(5) unsigned NOT NULL DEFAULT '0',
avatar_highdpi tinyint(3) unsigned NOT NULL DEFAULT '0',
gravatar varchar(120) NOT NULL DEFAULT '' COMMENT 'If specified, this is an email address corresponding to the user''s ''Gravatar''',
user_state enum('valid','email_confirm','email_confirm_edit','moderated','email_bounce','rejected','disabled') NOT NULL DEFAULT 'valid',
is_moderator tinyint(3) unsigned NOT NULL DEFAULT '0',
is_admin tinyint(3) unsigned NOT NULL DEFAULT '0',
is_banned tinyint(3) unsigned NOT NULL DEFAULT '0',
reaction_score int(11) NOT NULL DEFAULT '0',
warning_points int(10) unsigned NOT NULL DEFAULT '0',
taigachat_color char(6) NOT NULL DEFAULT '',
is_staff tinyint(3) unsigned NOT NULL DEFAULT '0',
cover_date int(10) unsigned NOT NULL DEFAULT '0',
credits decimal(19,4) NOT NULL DEFAULT '0.0000',
currency_id int(11) unsigned NOT NULL DEFAULT '0',
xfa_cui_type tinyint(3) unsigned NOT NULL DEFAULT '0',
xfa_cui_params text,
activity_visible tinyint(3) unsigned NOT NULL DEFAULT '1',
favorite_badge mediumblob,
awarded_trophy mediumblob,
auto_feature_badge tinyint(3) unsigned DEFAULT '0',
feature_badge_slide_options mediumblob,
cta_ft_featured_count int(10) unsigned NOT NULL DEFAULT '0',
secret_key varbinary(32) NOT NULL,
privacy_policy_accepted int(10) unsigned NOT NULL DEFAULT '0',
terms_accepted int(10) unsigned NOT NULL DEFAULT '0',
siropu_chat_room_id int(10) unsigned NOT NULL DEFAULT '1',
siropu_chat_conv_id int(10) unsigned NOT NULL DEFAULT '0',
siropu_chat_rooms blob,
siropu_chat_conversations blob,
siropu_chat_settings blob,
siropu_chat_status varchar(255) NOT NULL DEFAULT '',
siropu_chat_is_sanctioned tinyint(3) unsigned NOT NULL DEFAULT '0',
siropu_chat_message_count int(10) unsigned NOT NULL DEFAULT '0',
siropu_chat_last_activity int(11) NOT NULL DEFAULT '-1',
PRIMARY KEY (user_id),
UNIQUE KEY username (username),
KEY email (email),
KEY user_state (user_state),
KEY last_activity (last_activity),
KEY message_count (message_count),
KEY trophy_points (trophy_points),
KEY register_date (register_date),
KEY staff_username (is_staff,username),
KEY cta_ft_featured_count (cta_ft_featured_count),
KEY reaction_score (reaction_score),
KEY siropu_chat_room_id (siropu_chat_room_id),
KEY siropu_chat_message_count (siropu_chat_message_count),
KEY siropu_chat_last_activity (siropu_chat_last_activity)
) ENGINE=InnoDB AUTO_INCREMENT=14101 DEFAULT CHARSET=utf8
 
I don't know if it's connected, but it lists the same error 1054 and line about 217:

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'embed_metadata' in 'field list' in src/XF/Db/AbstractStatement.php at line 217
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 221
  6. XF\Db\AbstractAdapter->insert() in src/XF/Mvc/Entity/Entity.php at line 1452
  7. XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1184
  8. XF\Mvc\Entity\Entity->save() in src/XF/Service/Thread/Replier.php at line 167
  9. XF\Service\Thread\Replier->_save() in src/XF/Service/ValidateAndSavableTrait.php at line 40
  10. XF\Service\Thread\Replier->save() in src/XF/Pub/Controller/Thread.php at line 461
  11. XF\Pub\Controller\Thread->actionAddReply() in src/XF/Mvc/Dispatcher.php at line 321
  12. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
  13. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
  14. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
  15. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
  16. XF\App->run() in src/XF.php at line 390
  17. XF::runApp() in index.php at line 20
I get that now when I try to post to Siropu Chat.
 
Can you show the table structures for the following tables?

xf_reaction

CREATE TABLE xf_reaction (
reaction_id int(10) unsigned NOT NULL AUTO_INCREMENT,
text_color varchar(100) NOT NULL,
image_url varchar(200) NOT NULL,
image_url_2x varchar(200) NOT NULL DEFAULT '',
sprite_mode tinyint(3) unsigned NOT NULL DEFAULT '0',
sprite_params blob NOT NULL,
reaction_score int(11) NOT NULL DEFAULT '1',
display_order int(10) unsigned NOT NULL DEFAULT '1',
active tinyint(3) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (reaction_id),
KEY display_order (display_order)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4

xf_profile_post

CREATE TABLE xf_profile_post (
profile_post_id int(10) unsigned NOT NULL AUTO_INCREMENT,
profile_user_id int(10) unsigned NOT NULL,
user_id int(10) unsigned NOT NULL,
username varchar(50) NOT NULL,
post_date int(10) unsigned NOT NULL,
message mediumtext NOT NULL,
ip_id int(10) unsigned NOT NULL DEFAULT '0',
message_state enum('visible','moderated','deleted') NOT NULL DEFAULT 'visible',
attach_count smallint(5) unsigned NOT NULL DEFAULT '0',
reaction_score int(11) NOT NULL DEFAULT '0',
reactions blob,
reaction_users blob NOT NULL,
comment_count int(10) unsigned NOT NULL DEFAULT '0',
first_comment_date int(10) unsigned NOT NULL DEFAULT '0',
last_comment_date int(10) unsigned NOT NULL DEFAULT '0',
latest_comment_ids blob NOT NULL,
warning_id int(10) unsigned NOT NULL DEFAULT '0',
warning_message varchar(255) NOT NULL DEFAULT '',
embed_metadata blob,
PRIMARY KEY (profile_post_id),
KEY profile_user_id_post_date (profile_user_id,post_date),
KEY user_id (user_id),
KEY post_date (post_date)
) ENGINE=InnoDB AUTO_INCREMENT=30739 DEFAULT CHARSET=utf8

xf_profile_post_comment

CREATE TABLE xf_profile_post_comment (
profile_post_comment_id int(10) unsigned NOT NULL AUTO_INCREMENT,
profile_post_id int(10) unsigned NOT NULL,
user_id int(10) unsigned NOT NULL,
username varchar(50) NOT NULL,
comment_date int(10) unsigned NOT NULL,
message mediumtext NOT NULL,
ip_id int(10) unsigned NOT NULL DEFAULT '0',
message_state enum('visible','moderated','deleted') NOT NULL DEFAULT 'visible',
reaction_score int(11) NOT NULL DEFAULT '0',
reactions blob,
reaction_users blob NOT NULL,
warning_id int(10) unsigned NOT NULL DEFAULT '0',
warning_message varchar(255) NOT NULL DEFAULT '',
embed_metadata blob,
PRIMARY KEY (profile_post_comment_id),
KEY profile_post_id_comment_date (profile_post_id,comment_date),
KEY user_id (user_id),
KEY comment_date (comment_date)
) ENGINE=InnoDB AUTO_INCREMENT=575 DEFAULT CHARSET=utf8
 
Before I put you guys through the trouble of a ticket I decided to re-install XF 2 on another test installation to ensure it wasn't a problem during the upgrade. I made sure my host had all the PHP extensions and whatnot was turned on and updated to ensure a smooth install and I haven't had any of these problems on the second upgrade. I don't know what caused them on the first, but I think everyone is good now. Thanks for your help. If these problems reoccur on the second one, I'll send in a ticket. Thank you.
 
Back
Top Bottom