Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix create category

  • Loading branch information...
commit 63f03df311c5a42d513ed5a2d5c69d8d4a57ca39 1 parent f3070b2
@smaknsk smaknsk authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 protected/modules/admin/controllers/CategoryController.php
View
8 protected/modules/admin/controllers/CategoryController.php
@@ -33,7 +33,7 @@ public function actionCreate()
if (Yii::app()->params['server'] == CAlexHelper::DEVELOPMENT)
if (Yii::app()->request->isAjaxRequest) {
- if ($_POST['Category']['parent_id'] == '0') {
+ if ($_POST['Category']['parentId'] == '') {
$model = new Category();
$model->name = $_POST['Category']['name'];
$model->alias = $_POST['Category']['alias'];
@@ -41,7 +41,7 @@ public function actionCreate()
if ($model->saveNode())
echo 'success';
} else {
- $parent = $this->loadModel($_POST['Category']['parent_id']);
+ $parent = $this->loadModel($_POST['Category']['parentId']);
$model = new Category();
$model->name = $_POST['Category']['name'];
$model->alias = $_POST['Category']['alias'];
@@ -86,7 +86,7 @@ public function actionUpdateAjax()
if (Yii::app()->params['server'] == CAlexHelper::DEVELOPMENT)
if (Yii::app()->request->isAjaxRequest) {
$model = $this->loadModel($_POST['Category']['id']);
- if ($_POST['Category']['parent_id'] == $model->parent()->id) {
+ if ($_POST['Category']['parentId'] == $model->parent->id) {
$model->name = $_POST['Category']['name'];
$model->alias = $_POST['Category']['alias'];
@@ -97,7 +97,7 @@ public function actionUpdateAjax()
} else {
$model->deleteNode();
$model->refresh();
- $parent = $this->loadModel($_POST['Category']['parent_id']);
+ $parent = $this->loadModel($_POST['Category']['parentId']);
if ($parent->append($model)) {
$model->refresh();
Please sign in to comment.
Something went wrong with that request. Please try again.