CC-4207: Smart Playlists: Criteria is lost on 'Shuffle' click

-fixed
This commit is contained in:
denise 2012-08-10 11:56:01 -04:00
parent 7d73f0996c
commit bd966915ee
1 changed files with 9 additions and 2 deletions

View File

@ -565,8 +565,15 @@ class PlaylistController extends Zend_Controller_Action
{
$request = $this->getRequest();
$params = $request->getPost();
$bl = new Application_Model_Block($params['obj_id']);
$result = $bl->shuffleSmartBlock();
$bl = new Application_Model_Block($params['obj_id']);
//we need to save criteria in case user hasn't clicked Save or Generate yet
$result = $bl->saveSmartBlockCriteria($params['data']);
//only shuffle if there are no criteria errors
if ($result['result'] == 0) {
$result = $bl->shuffleSmartBlock();
}
if ($result['result'] == 0) {
try {
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));