From e07e0f5f11e445c69ca2374d970f87e6d935e58a Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Mon, 24 Sep 2007 22:09:01 -0400 Subject: [PATCH] Fix 'Using $this when not in object context error' by using the same method used in Application::canEdit() and Appliction::objectGetEntries() --- include/version.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/version.php b/include/version.php index 513ba1a..18a4e2b 100644 --- a/include/version.php +++ b/include/version.php @@ -1372,7 +1372,7 @@ class version { if($_SESSION['current']->hasPriv("admin")) return TRUE; - else if($this->iVersionId) + if(isset($this) && is_object($this) && $this->iVersionId) { if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId)) return TRUE; @@ -1381,9 +1381,10 @@ class version { return TRUE; return FALSE; - } - else + } else + { return FALSE; + } } public function mustBeQueued() @@ -1451,7 +1452,7 @@ class version { $iRows = maintainer::objectGetEntriesCount($bQueued, $bRejected); } - if($bQueued && !$this->canEdit()) + if($bQueued && !version::canEdit()) { /* Users should see their own rejected entries, but maintainers should not be able to see rejected entries for versions they maintain */