PHP Fatal error:  Call to a member function hasPerm() on a non-object in /var/www/vhosts/xxxxx/httpdocs/include/class.staff.php on line 457But I can access http://xxxx/scp/staff.php , /emails.php, /settings.php etc, normally.Line 457 in bold:    function hasPerm($perm, $global=true) {        if ($global)            return $this->getPermission()->has($perm);        if ($this->getRole()->hasPerm($perm))            return true;        foreach ($this->dept_access as $da)            if ($da->role->hasPerm($perm))                return true;        return false;    }

Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance.  The more information you give us the better we will be able to assist you. Thank you.

Ok, sorry man:Ubuntu 14.04.5Apache/2.4.7PHP 5.5.9-1ubuntu4.20Happens after osTicket upgrade from v1.9.4 to v1.10After I login (on http://xxx/scp/login.php) I get a blank page and error.log logs this: PHP Fatal error:  Call to a member function hasPerm()

on a non-object in

/var/www/vhosts/xxxxx/httpdocs/include/class.staff.php on line 457

Please try upgrading your PHP to 5.6 and see if that fixes the issue.

Unfortunately this would not be possible at this time because this server hosts other php applications that do not support 5.6 yet.

Are there any other option that I can try?Is that error saying that getRole() function is not an object?include/class.staff.php line 435:    function getRole($dept=null) {        $deptId = is_object($dept) ? $dept->getId() : $dept;        if ($deptId && $deptId != $this->dept_id) {            if (isset($this->_roles))                return $this->_roles;            if ($access = $this->dept_access->findFirst(array('dept_id' => $deptId)))                return $this->_roles = $access->role;            if (!$this->usePrimaryRoleOnAssignment())                // View only access                return new Role(array());            // Fall through to primary role        }        // For the primary department, use the primary role        return $this->role;    }I commented the lines 457 and 458 and the page loads fine, but if I click on a opened ticket, the page shows only the header of osticket panel and the ticket content does not appear.

4 years later

I know I am late to answer this. But today I was upgrading our osTicket system from version 1.8 to 1.14 and was having the same issue. Admin was working fine but when I was clicking on "Agent Panel" link, it was throwing the same error. After some debugging, I found that there is a new column "roleid" has been added to the "staff" table and the value of that column was 0. When I changed it from 0 to 1. It was working fine for me. Hope it will work for someone else.

Cheers

Write a Reply...