Error

Error

Call to a member function getMarcas() on null

/var/www/vhosts/balbino-faustino.pt/httpdocs/themes/front/views/site/categoria/_detalhe.php(46)

34         $text = $subcategoria->{'texto'.$langEscolhida};
35         $brands = $subcategoria->getMarcas();
36         $products = $subcategoria->relProdutosDisplayCat();
37         $products = array_merge($products, $categoria->relProdutosDisplayCat());
38         usort($products, function($a, $b){
39                     return strcmp($a->nome, $b->nome);
40                 });
41     }
42 }else{
43   $banner = Comp_Galeria::getImagemFullUrl($categoria->imagem, '_banner');
44   $name = $categoria->{'titulo'.$langEscolhida};
45   $text = $categoria->{'texto'.$langEscolhida};
46   $brands = $categoria->getMarcas();
47   $products = $categoria->relProdutos;
48 }
49 
50 $products = array_filter($products, function($el) use ($langEscolhida){ return $el->visibleLang($el->relCategoria,$langEscolhida); });
51 
52 if (count($brands)){ ?>
53     <script type="text/javascript">
54         var BRANDS = {};
55         var BIMAGE = {};
56     </script>
57 <?php } ?>
58 <!-- start page title section -->

Stack Trace

#3
+
 /var/www/vhosts/balbino-faustino.pt/httpdocs/themes/front/views/site/categoria/vista_0.php(46): CController->renderPartial("//site/categoria/_detalhe", array("categoria" => null, "produto" => null))
41             <!-- end parallax section -->
42 
43         <?php endforeach;
44 
45     }else{
46         $this->renderPartial('//site/categoria/_detalhe', array('categoria' => $categoria, 'produto' => $produto));
47     }
48 
49 } ?>
#8
+
 /var/www/vhosts/balbino-faustino.pt/httpdocs/protected/controllers/SiteController.php(440): CController->render("categoria/vista_0", array("langEscolhida" => "", "url2" => "", "url3" => "", "url4" => "", ...))
435                 'url2' => $url2,
436                 'url3' => $url3,
437                 'url4' => $url4,
438                 'categoria' => $categoria,
439                 'subcategoria' => $subcategoria,
440                 'produto' => $product
441             )
442         );
443 
444     }
445 
#12
+
 /var/www/vhosts/balbino-faustino.pt/httpdocs/protected/modules/UserAdmin/components/UAccessController.php(43): CFilterChain->run()
38                         $filterChain->run();
39                 }
40                 // If this controller or this action if free to access for everyone
41                 elseif ( ($this->freeAccess === true) OR (in_array($this->action->id, $this->freeAccessActions)) ) 
42                 {
43                         $filterChain->run();
44                 }
45                 // User is guest
46                 elseif (Yii::app()->user->isGuest) 
47                 {
48                         if ($this->_isRouteAllowed($this->_getGuestAllowedRoutes()))
2020-08-09 02:23:00 Apache Yii Framework/1.1.21