diff --git a/module/doc/control.php b/module/doc/control.php index c07f637a93..fc95b0feaa 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -158,7 +158,7 @@ class doc extends control if(!empty($lib) and (!empty($lib->product) or !empty($lib->project)) and $browseType != 'bymodule') { $count = $this->dao->select('count(*) as count')->from(TABLE_DOCLIB)->where('project')->eq($lib->project)->andWhere('product')->eq($lib->product)->fetch('count'); - if($count == 1) + if($count == 1 and $type and isset($lib->$type)) { $objectLibs = $this->doc->getLibsByObject($type, $lib->$type); if(isset($objectLibs['project'])) $attachLibs['project'] = $objectLibs['project']; diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 948518eec6..9404ef5502 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -50,7 +50,7 @@ var browseType = ''; " . $this->lang->doc->create, '', "class='btn btn-primary'");?> diff --git a/module/doc/view/browsebygrid.html.php b/module/doc/view/browsebygrid.html.php index 7d4f4bba74..9c07800d9a 100644 --- a/module/doc/view/browsebygrid.html.php +++ b/module/doc/view/browsebygrid.html.php @@ -15,7 +15,7 @@ " . $this->lang->doc->create, '', "class='btn btn-primary'");?>