Fixed post deleted by user => undelete post


Well-known member
Affected version
ErrorException: [E_NOTICE] Trying to get property 'reaction_score' of non-object in src/XF/Repository/Reaction.php at line 459

    XF::handlePhpError() in src/XF/Repository/Reaction.php at line 459
    XF\Repository\Reaction->fastUpdateReactionIsCounted() in src/XF/Repository/Reaction.php at line 406
    XF\Repository\Reaction->recalculateReactionIsCounted() in src/XF/Behavior/Reactable.php at line 39
    XF\Behavior\Reactable->postSave() in src/XF/Mvc/Entity/Entity.php at line 1269
    XF\Mvc\Entity\Entity->save() in src/XF/ControllerPlugin/Undelete.php at line 30
    XF\ControllerPlugin\Undelete->actionUndelete() in src/XF/Pub/Controller/Post.php at line 313
    XF\Pub\Controller\Post->actionUndelete() in src/XF/Mvc/Dispatcher.php at line 350
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
    XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2326
    XF\App->run() in src/XF.php at line 488
    XF::runApp() in index.php at line 20

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.6).

Change log:
Prevent an error when trying to update reactions counts if we find a reaction content entry without a matching reaction definition.
There may be a delay before changes are rolled out to the XenForo Community.