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 RM makretplace issue Call to a member function isForSaleInMarketplace()

F2uG2u

New Member
  • Error: Call to a member function isForSaleInMarketplace() on null
  • src/addons/XFA/RMMarketplace/XFRM/Pub/Controller/ResourceItem.php:322
  • Generated by: Unknown account
and i view this page code like:
PHP:
  public function actionMove(ParameterBag $params)
    {
        $response = parent::actionMove($params);

        if ($response instanceof \XF\Mvc\Reply\View)
        {
            $resource = $response->getParam('resource');

            /* Need to reconstruct category list if the resource is paid */
            if ($resource->isForSaleInMarketplace())
            {
                $categoryRepo   = $this->getCategoryRepo();
                $categories     = $categoryRepo->getViewableCategories();

                foreach($categories AS $idx => $category)
                {
                    if ($resource->xfa_rmmp_type == 'digital')
                    {
                        if ($category->xfa_rmmp_types['digital']['active'] == 0)
                        {
                            unset($categories[$idx]);
                        }
                    }
                    else
                    {
                        if ($category->xfa_rmmp_types[$resource->xfa_rmmp_type] == 0)
                        {
                            unset($categories[$idx]);
                        }
                    }
                }

                $response->setParam('categoryTree', $categoryRepo->createCategoryTree($categories));
            }
        }

        return $response;
    }

But it is not get right resource information .so you need to change code like
from
$resource = $response->getParam('resource');
to
$resource = $this->assertViewableResource($params->resource_id);
 
Top