diff --git a/Paging.class.php b/Paging.class.php index 51b82ce..81e3588 100644 --- a/Paging.class.php +++ b/Paging.class.php @@ -498,6 +498,9 @@ public function getPageGroupById($group){ $stmt = $this->Database->prepare($sql); $stmt->execute([':group' => $group]); $results = $stmt->fetch(PDO::FETCH_ASSOC); + if (!$results) { + return false; + } $results['default_group'] = $this->getDefaultGroup(); return $results; } diff --git a/functions.inc.php b/functions.inc.php index a45d905..cf1b7ca 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -927,6 +927,7 @@ function paging_check_extensions($exten=true) { function paging_get_devs($grp) { global $db; + $tmparray = []; $grp = $db->escapeSimple($grp); $sql = "SELECT ext FROM paging_groups where page_number='$grp'"; diff --git a/views/form.php b/views/form.php index 8515e1d..b36277f 100644 --- a/views/form.php +++ b/views/form.php @@ -5,7 +5,21 @@ $thisGRP = paging_get_pagingconfig($extdisplay); $devices = paging_get_devs($extdisplay); $devices = is_array($devices)?$devices:array(); - extract($thisGRP); + if(is_array($thisGRP)){ + extract($thisGRP); + } else { + $thisGRP = []; + $description = ''; + $volume = '0'; + $force_page = "0"; + $devices = array(); + $ext = ''; + $pagenbr = ''; + $pagegrp = ''; + $delURL = ''; + $duplex = '0'; + } + $pagenbr = $extdisplay; $pagegrp = $extdisplay; $delURL = '?display=paging&action=delete&extdisplay='.urlencode($extdisplay);