I tried a great deal of research in this site for these kind of errors but couldnt figure out my problem so posting it here.
first the error message:-
{"success":false,"message":"\u0630\u062e\u06cc\u0631\u0647 \u062f\u0686\u0627\u0631 \u062e\u0637\u0627 \u0634\u062f . \u0644\u0637\u0641\u0627 \u062f\u0648\u0628\u0627\u0631\u0647 \u0633\u0639\u06cc \u06a9\u0646\u06cc\u062f"}
The method that is calling the view is
Method
public function checklist(){
if($this->request->is('ajax')){
parent::edit();
}
$this->set('tree',$this->Task->Attribute->getTree(array('Attribute.mode' => 'checkable')));
}
The method involved in this action
Method
protected function _extraSave($task_id){
$success = false;
if('Check' == ifExist($this->Task->getFieldValue($task_id ,'type'))){
if(ifExist($this->request->data ,'TaskAttribute')){
$taskAttributeModel = $this->_getModel('TaskAttribute');
foreach($this->request->data['TaskAttribute'] as $attribute){
if(0 != $attribute['attribute_id']){
$taskAttributeModel->id = false;
if(!$success = $taskAttributeModel->save(array($taskAttributeModel->alias=>array('task_id'=>$task_id ,'attribute_id'=> $attr['attribute_id'] ,'value'=>$attribute['value'])))){
break;
}
}
}
}
}
return $success ;
}
The method i am using to fetch the data is
Method
public function getTree($branch_id =false){
$data = array();
$result = $this->find('all',array(
'fields' => array('Attribute.name', 'Attribute.id','Attribute.type','AttributeOptions.id','AttributeOptions.label', 'Item.category_id', 'Item.id','Item.model','Item.service','Category.id','Category.name'),
'joins' => array(
array(
'table' => 'attributes',
'alias' => 'Attribute',
'type' => 'INNER',
'conditions' => 'TaskAttribute.attribute_id = Attribute.id',
),
array(
'table' => 'item_attributes',
'alias' => 'ItemAttribute',
'type' => 'INNER',
'conditions' => 'ItemAttribute.attribute_id = Attribute.id'
),
array(
'table' => 'items',
'alias' => 'Item',
'type' => 'INNER',
'conditions' => 'ItemAttribute.item_id = Item.id'
),
array(
'table' => 'taxonomies',
'alias' => 'Category',
'type' => 'LEFT',
'conditions' => 'Item.category_id = Category.id'
),
array(
'table' => 'attribute_options',
'alias' => 'AttributeOptions',
'type' => 'LEFT',
'conditions' => 'Attribute.id = AttributeOptions.attribute_id'
)
),
'recursive'=>-1
)
);
Expecting a expert solution for it.. to be noted I am new to Cake.