CC-4248: Playlist Builder: 'Something went wrong' error message when dragging playlist into playlist
-fixed
This commit is contained in:
parent
764316a36c
commit
817fe13533
|
@ -155,6 +155,11 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$this->view->error = "You can only add tracks to smart playlists.";
|
$this->view->error = "You can only add tracks to smart playlists.";
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function wrongTypeToPlaylist($obj) {
|
||||||
|
$this->view->error = "You can only add tracks and smart playlists to playlists.";
|
||||||
|
$this->createFullResponse($obj);
|
||||||
|
}
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
@ -308,6 +313,13 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
try {
|
try {
|
||||||
$obj = $this->getPlaylist($obj_type);
|
$obj = $this->getPlaylist($obj_type);
|
||||||
if ($obj_type == 'playlist') {
|
if ($obj_type == 'playlist') {
|
||||||
|
foreach($ids as $id) {
|
||||||
|
if (is_array($id) && isset($id[1])) {
|
||||||
|
if ($id[1] == 'playlist') {
|
||||||
|
throw new WrongTypeToPlaylistException;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$obj->addAudioClips($ids, $afterItem, $addType);
|
$obj->addAudioClips($ids, $afterItem, $addType);
|
||||||
} else if ($obj->isStatic()) {
|
} else if ($obj->isStatic()) {
|
||||||
// if the dest is a block object
|
// if the dest is a block object
|
||||||
|
@ -334,6 +346,9 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
catch (WrongTypeToBlockException $e) {
|
catch (WrongTypeToBlockException $e) {
|
||||||
$this->wrongTypeToBlock($obj);
|
$this->wrongTypeToBlock($obj);
|
||||||
}
|
}
|
||||||
|
catch (WrongTypeToPlaylistException $e) {
|
||||||
|
$this->wrongTypeToPlaylist($obj);
|
||||||
|
}
|
||||||
catch (BlockDynamicException $e) {
|
catch (BlockDynamicException $e) {
|
||||||
$this->blockDynamic($obj);
|
$this->blockDynamic($obj);
|
||||||
}
|
}
|
||||||
|
@ -609,4 +624,5 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class WrongTypeToBlockException extends Exception {}
|
class WrongTypeToBlockException extends Exception {}
|
||||||
|
class WrongTypeToPlaylistException extends Exception {}
|
||||||
class BlockDynamicException extends Exception {}
|
class BlockDynamicException extends Exception {}
|
||||||
|
|
Loading…
Reference in New Issue