Fatal error when editing ticket

Project:ProjectPier
Version:0.8.8-stable
Component:Code
Category:bug report
Priority:normal
Assigned:phpfreak
Status:open - assigned
Description

Hello. With a recently created user when going to Project >> Tickets and clicking on a ticket to edit it, after pressing "Save", the system throws a fatal error (Sorry, fatal error happened, please explain what you were doing, etc.).

I've been trying different combinations: user being an admin and not, and editing different types of tickets. It seems that when the ticket has been created by a client, it works properly.

The interesting thing is that the ticket is actually edited and changes saved, with the only problem of the error thrown.

The system log reports this:

Session "default" started at 2012-02-09T09:17:03+0000
#1 ERROR: Error: Undefined variable: changeset in 'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\application\views\notifier\edit_ticket.php' on line 27 (error code: 8)

PHP version: 5.2.17
PP Release: 0.88
Error: Call to a member function getChanges() on a non-object
File: application\views\notifier\edit_ticket.php
Request: /projectpier/index.php?c=tickets&a=edit_ticket&1328779252&id=5&active_project=3

Thanks for keeping developing this excellent software!

Regards,

#1
Assigned to:Visitor» phpfreak
Status:new» open - assigned

Confirmed. The code needs a fix. I haven't tested it yet but it may be solved by changing $changeset into $ticket in application\views\notifier\edit_ticket.php at line 27.

#2

There's another $changeset variable in application\views\notifier\ticket_change.php, but after replacing both with $ticket, I get an exception:

exception 'Exception' with message 'Call to undefined method DataObject::getComment() or column comment' in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\environment\classes\dataaccess\DataObject.class.php:1258
Stack trace:
#0 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\application\views\notifier\edit_ticket.php(51): DataObject->__call('getComment', Array)
#1 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\application\views\notifier\edit_ticket.php(51): ProjectTicket->getComment()
#2 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\environment\classes\template\Template.class.php(77): include('C:\Program File...')
#3 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\environment\classes\template\Template.class.php(48): Template->includeTemplate('C:/Program File...')
#4 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\environment\classes\template\template.php(35): Template->fetch('C:/Program File...')
#5 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\application\models\notifier\Notifier.class.php(212): tpl_fetch('C:/Program File...')
#6 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\application\plugins\tickets\controllers\TicketsController.class.php(345): Notifier::ticket(Object(ProjectTicket), Array, 'edit_ticket', Object(User))
#7 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\environment\classes\controller\Controller.class.php(71): TicketsController->edit_ticket()
#8 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\environment\classes\controller\PageController.class.php(71): Controller->execute('edit_ticket')
#9 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\environment\classes\Env.class.php(131): PageController->execute('edit_ticket')
#10 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\init.php(189): Env::executeAction('tickets', 'edit_ticket')
#11 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\projectpier\index.php(11): require('C:\Program File...')
#12 {main}
#3

Best to remove these 5 lines for now:

  echo "\n";
  if (trim($changeset->getComment())) {
    echo lang('comment').":\n";
    echo $changeset->getComment();
  } // if

You could try this:

  echo "\n";
  if (trim($ticket->getSummary())) {
    echo lang('comment').":\n";
    echo $ticket->getSummary();
  } // if
#4

works for me!. thanks