Closed whiteflash34 closed 7 years ago
We've been using handler_id
as a column since this plugin was created in 2014. Why exactly is this incorrect?
It's actually $this that's the issue, not hanlder_id. $this is not an object that is in scope of the function. It was causing a fatal error on MantisBT 2.5 when updating a ticket. Seems to work when creating and adding notes, but not updating.
Understood, but if we're using handler_id
successfully, this means that the function works correctly. What PHP version are you using? I will test with Mantis 2.5.
Also, it's better to submit pull requests instead of showing code changes in the issue.
PHP Version 5.3.27. Agreed. I'll do a pull next time.
Using Mantis 2.5.1 and PHP 5.5.9-1ubuntu4.21 and the plugin works. I suggest you upgrade PHP.
The following lines are incorrect:
` 'reporter_id' => function($bug) { return $this->get_user_name($bug->reporter_id); }, 'handler_id' => function($bug) { return empty($bug->handler_id) ? plugin_lang_get('no_user') : $this->get_user_name($bug->handler_id); },
`
they should be replaced with:
` 'reporter_id' => function($bug) use($self) { return $self->get_user_name($bug->reporter_id); }, 'handler_id' => function($bug) use($self) { return empty($bug->handler_id) ? plugin_lang_get('no_user') : $self->get_user_name($bug->handler_id); },
`