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 Fixed This is due to the fact that DigitalProduct is saved only on finalizeResourceCreate, and some of your addons tries to call canView()

NICK97

Member
Unfortunately I have found this bug related to your add-ons and I have contact different developer to confirm the issue this is what’s he says

This is due to the fact that DigitalProduct is saved only on finalizeResourceCreate, and some of your addons tries to call canView() method for resource discussion thread BEFORE the resource saving is completed.


XFA\RMMarketplace\XF\Entity\Thread

Code:
public function canView(&$error = null)
    {
        $canView = parent::canView($error);
....
        // Has purchased product or own license
        if ($resource->xfa_rmmp_type == 'digital')
        {
            if ($resource->DigitalProduct // TODO: make sure it's exists since the resource type does not  mean that the relation is saved yet
              && $resource->DigitalProduct->hasValidLicense())
            {
                return true;
            }
        }
        else
        {
            if ($resource->ValidPurchase)
            {
                return true;
            }
        }

        return false;
    }

here some screenshots
B0750D3B-FC94-484B-AC8B-AA1C11FAF2F1.png
2993EE99-9B41-4BAA-A19E-C5372F0E28A5.png
 

Attachments

  • 006E4B2C-40D0-44A5-890F-2FCB287A3E8D.png
    006E4B2C-40D0-44A5-890F-2FCB287A3E8D.png
    211.3 KB · Views: 3

NICK97

Member
When do you get that error exactly ?
This happened if I check this box Restrict support thread access and created a resource with uploaded file and this is only happening if some of your addons tries to call canView() method for resource discussion thread BEFORE the resource saving is completed.
 

Clement

Freaky Coder
Staff member
I just tried on a vanilla install but I can't reproduce that.

I am not calling canView so I guess this comes from another add-on you have ?
 

Clement

Freaky Coder
Staff member
I did apply the suggested modification yes.
I don't have an ETA, it will depends of what I implement.
 
Top