Skip to content
Snippets Groups Projects

Fix for #1523 - Optimization of record label computation.

Merged Akshath requested to merge akshath/vtigercrm:fix_1523 into master

Areas validated

  • User CRUD (both admin and non-admin)
  • Create or Update records from workflows
  • CRUD from APIs

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Akshath Added 1 commit:

    Added 1 commit:

  • 278 278 if ($module == 'Events') {
    279 279 $module = 'Calendar';
    280 280 }
    281
    282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module);
    283 $entityFieldNames = explode(',', $entityFields['fieldname']);
    284 switch ($module) {
    285 case 'HelpDesk': $entityFieldNames = array('ticket_title');
    286 break;
    287 case 'Documents': $entityFieldNames = array('notes_title');
    288 break;
    289 }
    290
    291 $record_label = '';
    292 foreach($entityFieldNames as $entityFieldName) {
    293 $record_label .= $this->column_fields[$entityFieldName]." ";
  • @akshath Also, as part of this merge, shouldn't the file containing the Event Handler be removed as well? I just grepped the source tree and found that there are two files that are basically the same!!! FWIW, the one in the root of the Vtiger module directory was replaced in the event table in the 600_to_610 migration routine.

    ./modules/Vtiger/RecordLabelUpdater.php:12:class Vtiger_RecordLabelUpdater_Handler extends VTEventHandler {
    ./modules/Vtiger/handlers/RecordLabelUpdater.php:12:class Vtiger_RecordLabelUpdater_Handler extends VTEventHandler {
  • Akshath @akshath started a thread on the diff
  • 278 278 if ($module == 'Events') {
    279 279 $module = 'Calendar';
    280 280 }
    281
    282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module);
    283 $entityFieldNames = explode(',', $entityFields['fieldname']);
    284 switch ($module) {
    285 case 'HelpDesk': $entityFieldNames = array('ticket_title');
    286 break;
    287 case 'Documents': $entityFieldNames = array('notes_title');
    288 break;
    289 }
    290
    291 $record_label = '';
    292 foreach($entityFieldNames as $entityFieldName) {
    293 $record_label .= $this->column_fields[$entityFieldName]." ";
  • Author Contributor

    @lord_alan I did not notice we have modules/Vtiger/RecordLabelUpdater.php. Let remove this file as well.

  • 278 278 if ($module == 'Events') {
    279 279 $module = 'Calendar';
    280 280 }
    281
    282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module);
    283 $entityFieldNames = explode(',', $entityFields['fieldname']);
    284 switch ($module) {
    285 case 'HelpDesk': $entityFieldNames = array('ticket_title');
    286 break;
    287 case 'Documents': $entityFieldNames = array('notes_title');
    288 break;
    289 }
    290
    291 $record_label = '';
    292 foreach($entityFieldNames as $entityFieldName) {
    293 $record_label .= $this->column_fields[$entityFieldName]." ";
  • 👍

  • Akshath Added 1 commit:

    Added 1 commit:

  • Uma Status changed to merged

    Status changed to merged

  • Alan Lord
    Alan Lord @lord_alan started a thread on commit 4d67b5fc
  • 281 281
    282 282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module);
    283 283 $entityFieldNames = explode(',', $entityFields['fieldname']);
    284 $label = (count($entityFieldNames) > 1) ?
    284 switch ($module) {
    285 case 'HelpDesk': $entityFieldNames = array('ticket_title');
    • @prasad @akshath Why are you hard-coding the entity fieldnames here? I have many customers who use the "Ticket No." as the entityfield as it is Unique and very easy for everyone to understand - the ticket title is often something facile like "customer bug" or "widget not working"... Similarly with Documents. The notes title is often just a cut & paste and is the same for multiple documents. It can also be a rather long string so when viewed in a related record or a list it gets truncated. Using the "Document No." is again rather common with several of my customers.

    Please register or sign in to reply
    Loading