Author Topic: Bug on TaskController.class.php grouping by Tags  (Read 343 times)

dbastreghi

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Bug on TaskController.class.php grouping by Tags
« on: April 18, 2018, 12:47:50 PM »
First: I have tried to post it on Mantis. But there is a problem with captcha. So I cant create an account.

Second: Sorry about my english. It's not very good. But I will try to make it clear.

About the issue:

On tasks list, after set group by tags, I got this message:

Code: [Select]
Fatal error: Call to a member function getId() on null in /.../application/controllers/TaskController.class.php on line 1968

To solve it, I edited TaskController.class.php:

Line 1968:
Code: [Select]

            if (count($otf)){ # Added this line
            if ($otf->getId() == $member_type_id){
                $acontext = active_context();

                $ot_customer = ObjectTypes::findByName('customer');
                $ot_customer_id = $ot_customer->getId();

                $ot_project = ObjectTypes::findByName('project');
                $ot_project_id = $ot_project->getId();

                foreach ($acontext as $scontext){
                    if ($scontext instanceof Member) {
                        $scontext_ot = $scontext->getObjectTypeId();
                        if ($scontext_ot == $ot_project_id) {
                            $ot_project_folder = ObjectTypes::findByName('project_folder');
                            $member_type_id = $ot_project_folder->getId();
                        }
                        if ($scontext_ot == $ot_customer_id) {
                            $ot_customer_folder = ObjectTypes::findByName('customer_folder');
                            $member_type_id = $ot_customer_folder->getId();
                        }
                    }
}

}
            }  # Added this line

So, group tasks by tags came back to life.

 

anything