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

A bug in class.ticket.php blocks full ticket functionality - please update the source code

I experienced a bug which was produced, most probably, by an old version of osTicket.

Having installed version 1.9.8, my clients submited several issues, but when I tried to open them, I cannot see anything after issue subject.

Upgrading the system to the version 1.10 RC3 didn't solve the problem.

I installed the copy of the system on my local computer and started the debug session and find out that there is a bug as follows:
\include\class.ticket.php file, line 568 time-to-time creates an error as follows: call to a member function getDesc() on string. So, after the code review I made a bug fix as follows:
The code before the fix:

    function getPriority() {
        if (($a = $this->_answers['priority']) && ($b = $a->getValue()))
            if(method_exists($b, 'getDesc'))
        return '';
    }

and the code after the fix:

    function getPriority() {
        if (($a = $this->_answers['priority']) && ($b = $a->getValue())) {
            if(method_exists($b, 'getDesc'))
                return $b->getDesc();
            else
                return (string)$b;
        }
        return '';
    }


Hope such a fix can make the system more stable.

Thx. Vlad.
Tagged:

Comments

  • Additionally, I have found another function, which has been fixed as well. the function to be fixed is as follows: function getPriorityId(),

    and the fixed code is as follows:

        function getPriorityId() {
            global $cfg;

            if (($a = $this->_answers['priority'])
                && ($b = $a->getValue())
            ) {
                if(method_exists($b, 'getId')) {
                    return $b->getId();
                } else {
                    $b = $a->ht['field_id'];
                    return $b;
                }
            }
            return $cfg->getDefaultPriorityId();
        }

    Hope it helps to make the system better...
  • The devs have asked that 1.10rc# bugs be reported on github.
Sign In or Register to comment.