What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

  • We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug Resolved RM Marketplace SQL query was too much

F2uG2u

New Member
hello ,i think you need to rewrite code about class extensions
XFA\RMMarketplace\XF\Entity\Thread

i think it have issue about search more query in all website all page include homepage .thread etc.
maybe only resource page or resource related thread
Code:
  // Get resource
        $resource = \XF::repository('XFRM:ResourceItem')->findResourceForThread($this)->with(['Category','ValidPurchase'])->fetchOne();

        // Not linked to a resource anymore
        if (!$resource)
        {
            return true;
        }

        // Resource owner or free resource or support thread not restricted
        if ($resource->user_id == \XF::visitor()->user_id
            || $resource->xfa_rmmp_type == 'none'
            || !$resource->Category->xfa_rmmp_restrict_support)
        {
            return true;
        }

        // Has purchased product or own license
        if ($resource->xfa_rmmp_type == 'digital')
        {
            if ($resource->DigitalProduct
                && $resource->DigitalProduct->hasValidLicense())
            {
                return true;
            }
        }
        else
        {
            if ($resource->ValidPurchase)
            {
                return true;
            }
        }
 
Last edited:

F2uG2u

New Member
check canview was request to get resource,maybe change to usergroup permission check ,is it better than now?
 

Clement

Freaky Coder
Staff member
I can't really change that code to not retrieve the resource as this is used to restrict access to threads that require a purchase to access the resource thread.

But I'll think something out to only retrieve resource for those particular ones.
 
Top