From ffbdba6f6be837126a15ec2bbfa584dd2b902fc6 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 21 Aug 2012 16:37:33 -0400 Subject: [PATCH] CC-4260: Add-user: Undefined index: ftype -fixed --- airtime_mvc/application/models/Datatables.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/airtime_mvc/application/models/Datatables.php b/airtime_mvc/application/models/Datatables.php index 66737b7d9..c4ec7df35 100644 --- a/airtime_mvc/application/models/Datatables.php +++ b/airtime_mvc/application/models/Datatables.php @@ -90,17 +90,21 @@ class Application_Model_Datatables // we need to go over all items and fix length for playlist // in case the playlist contains dynamic block foreach ($results as &$r) { - if ($r['ftype'] == 'playlist') { - $pl = new Application_Model_Playlist($r['id']); - $r['length'] = $pl->getLength(); - } else if ($r['ftype'] == "block") { - $bl = new Application_Model_Block($r['id']); - if ($bl->isStatic()) { - $r['bl_type'] = 'static'; - } else { - $r['bl_type'] = 'dynamic'; + //this function is also called for Manage Users so in + //this case there will be no 'ftype' + if (isset($r['ftype'])) { + if ($r['ftype'] == 'playlist') { + $pl = new Application_Model_Playlist($r['id']); + $r['length'] = $pl->getLength(); + } else if ($r['ftype'] == "block") { + $bl = new Application_Model_Block($r['id']); + if ($bl->isStatic()) { + $r['bl_type'] = 'static'; + } else { + $r['bl_type'] = 'dynamic'; + } + $r['length'] = $bl->getLength(); } - $r['length'] = $bl->getLength(); } } } catch (Exception $e) {