Redirect Problem

I have a controller that calls an insert to a model then redirects to a view (CGridView)

Works great.

I have another function that is essentially identical but does not redirect. The function performs an update of the model gets called using updateAll($criteria) and works fine, but the redirect never happens. If I comment out the update, the redirect does occur.

Here is my controller code.




    public function actionCreateReviewlist($id) {     


	PartnerSite::model()->createReviewList($id);

		

	$model = new PartnerSite('search');

	$model->unsetAttributes();

	if (isset($_GET['PartnerSite']))

                $model->setAttributes($_GET['PartnerSite']);


	$this->render('reviewlist', array(

                'model' => $model, 'partner_id' => $id,

        ));

	

    }


    public function actionReviewlist($id) {

       

	$model = new PartnerSite('search');

	$model->unsetAttributes();

	if (isset($_GET['PartnerSite']))

                $model->setAttributes($_GET['PartnerSite']);

	$this->render('reviewlist', array(

                'model' => $model, 'partner_id' => $id,

        ));

    }


    public function actionReleaseNew($id) {     


	PartnerSite::model()->releaseNew($id);	


	$model = new PartnerSite('search');

	$model->unsetAttributes();

	if (isset($_GET['PartnerSite']))

                $model->setAttributes($_GET['PartnerSite']);


	$this->render('reviewlist', array(

                'model' => $model, 'partner_id' => $id,

        ));

//	$this->redirect(array('blacklist','id'=>$id));

    }



Any ideas? Thanks in Advance.

I think it must be some error condition coming out of the updateAll() method but it seems to work fine. The fact the redirect

does not occur makes me think it is not returning.

I found the problem ! The method returns the number of rows updated rather than a model.

I started with a copy from another forum post…

I changed $model to $rows and the way I was using it…all good now.





public function releaseNew($id)

	{		

		$newStatus = 'NeedReview';

		$criteria = array(					

			'condition'=>' approve="New" and partner_id ='.$id , 			

		);

	        //$model = $this->updateAll(array('approve'=>$newStatus), $criteria);				

		//if ($model->validate())

                // $model->save();	

		$rows = $this->updateAll(array('approve'=>$newStatus), $criteria);				

		if($rows>0) 

		 $this->save();	

	}