Fixed Additional queries behaviour on resource updates due to reactions and bookmarks

Valhalla

Well-known member
Affected version
2.2.4
Each new update on resource updates pages generates additional queries to fetch both reaction content and bookmark items, which are implemented through the ResourceUpdate entity via addReactableStructureElements($structure) and addBookmarkableStructureElements($structure).

For my own purposes, this behaviour also occurs when implementing reactions on resource reviews which is overcome by fetching with Reactions on the ResourceRating entity.

PHP:
if (isset($structure->withAliases['full']))
{
    $structure->withAliases['full'][] = function()
    {
        $visitorId = \XF::visitor()->user_id;
        if ($visitorId)
        {
            return 'Reactions|' . $visitorId;
        }
    };
}
 
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 XFRM release (2.2.5).

Change log:
Reduce query usage when listing a resource's updates
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom