From 7cdb08941d50419f6388bed8225ceb39ec5a1d57 Mon Sep 17 00:00:00 2001 From: Karnovsky A Date: Wed, 6 Apr 2016 14:17:45 +0300 Subject: [PATCH] Some fixes --- backend/controllers/BrandController.php | 2 +- common/modules/product/models/Product.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/controllers/BrandController.php b/backend/controllers/BrandController.php index a148c1c..d3eb8c2 100644 --- a/backend/controllers/BrandController.php +++ b/backend/controllers/BrandController.php @@ -28,7 +28,7 @@ class BrandController extends Controller 'allow' => true, ], [ - 'actions' => ['logout', 'index'], + 'actions' => ['logout', 'index', 'create', 'update', 'view', 'delete'], 'allow' => true, 'roles' => ['@'], ], diff --git a/common/modules/product/models/Product.php b/common/modules/product/models/Product.php index f09eeed..e866f0b 100644 --- a/common/modules/product/models/Product.php +++ b/common/modules/product/models/Product.php @@ -142,7 +142,7 @@ class Product extends \yii\db\ActiveRecord public function getFullName() { - return $this->brand->name .' '. $this->name; + return empty($this->brand) ? $this->name : $this->brand->name .' '. $this->name; } public function getCategories() { -- libgit2 0.21.4