VTiger 7.1 – Workaround for Historie view

VTiger have a small bug, that the Historie of some Modules are displayed with wrong user datas. If someone made changes only the “Admin Administartor” will be displayed as a changer and not the real user.

Here we have a workaround to fix this bug. Its because the UserID for Admin will be 1 and the usersID is something else and the code reads it wrong way.

I have checked and it only happens in Modules: Helpdesk, Service Contracts, Assets, Invoices and Sales Order. The rest of the modules are getting the correct whodid ID’s. Its only these modules where the updates are admin or whodid id 1.


Here we go to the Workaround:

We will have to change some code her in that file and all newly changes will be shown with the new real User ID of the Editor.

Go inside that file: modules/ModTracker/ModTrackerHandler.php

Insert at the Top of the Function down to modulename.

       function handleEvent($eventName, $data) {
               global $adb;
               $current_user = Users_Record_Model::getInstanceById($current_user_id, 'Users');
               global $current_user;
               $moduleName = $data->getModuleName();

After inserting change line 52 with the new variable to that:

                                                       $adb->pquery('INSERT INTO vtiger_modtracker_basic(id, crmid, module, whodid, changedon, status)
                                                                               VALUES(?,?,?,?,?,?)', Array($this->id, $recordId, $moduleName,
                                                                               $curid, $changedOn, $status));

Just save it and try making a change in some modules.


Attention: The changes you made are on your own risks.

about the author