Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Fatal error after upgrade (v1.9.4 to v1.10)

[Fri Nov 18 14:30:01.942106 2016] [:error] [pid 8320] [client 127.0.0.1:55650] 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

But 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;
    }

Comments

  • 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.5
    Apache/2.4.7
    PHP 5.5.9-1ubuntu4.20
    Happens after osTicket upgrade from v1.9.4 to v1.10

    After I login (on http://xxx/scp/login.php) I get a blank page and error.log logs this:
    [Fri Nov 18 14:30:01.942106 2016] [:error] [pid 8320] [client
    127.0.0.1:55650] 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[$deptId]))
                    return $this->_roles[$deptId];

                if ($access = $this->dept_access->findFirst(array('dept_id' => $deptId)))
                    return $this->_roles[$deptId] = $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.
Sign In or Register to comment.