diff --git a/resources/inc/class.resources_ui.inc.php b/resources/inc/class.resources_ui.inc.php index 5b28197e4a..1c2cff44e9 100755 --- a/resources/inc/class.resources_ui.inc.php +++ b/resources/inc/class.resources_ui.inc.php @@ -480,7 +480,7 @@ class resources_ui if (isset($_GET['res_id'])) $res_id = $_GET['res_id']; if (isset($nm_session_data['filter2']) && $nm_session_data['filter2'] > 0) $accessory_of = $nm_session_data['filter2']; if (isset($_GET['accessory_of'])) $accessory_of = $_GET['accessory_of']; - $content = is_array($content) ? $content : array('res_id' => $res_id); + $content = is_array($content) ? $content : array('res_id' => $res_id, 'cat_id' => $content['cat_id']); if ($res_id > 0) { $content = array_merge($this->bo->read($res_id), $content); @@ -500,7 +500,7 @@ class resources_ui } $content['cat_id'] = $owner['cat_id']; $content['bookable'] = true; - } else { + } elseif (count($content) === 2) { // New resource $content['cat_id'] = $nm_session_data['filter']; $content['bookable'] = true; @@ -585,4 +585,4 @@ class resources_ui return $this->tmpl->exec('resources.resources_ui.edit',$content,$sel_options,$read_only,$preserv,2); } -} +} \ No newline at end of file