Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact last touch point select SQL has a column (emails.date_sent_received) on a wrong table (notes) instead of emails. #555

Open
gmcodentech opened this issue Oct 14, 2024 · 0 comments
Labels
Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Severity: Moderate Minor Impact Type: Bug Something isn't working

Comments

@gmcodentech
Copy link

Issue

There is a fatal error reported in the log file from the 8.7 version. The error is not displayed on the UI but reported in the log file.
Error:

SubpanelCustomQueryPort: Error executing custom query Query Failed: SELECT  emails.`date_sent_received`   FROM notes   LEFT JOIN  contacts contacts ON notes.contact_id=contacts.id AND contacts.deleted=0
 AND contacts.deleted=0  LEFT JOIN  users jt1 ON notes.assigned_user_id=jt1.id AND jt1.deleted=0
 AND jt1.deleted=0 INNER JOIN  contacts notes_rel ON notes.contact_id=notes_rel.id AND notes_rel.deleted=0
  where ( notes.contact_id='257653c8-87fa-11ef-8040-78726430b17c') AND notes.deleted=0   ORDER BY  emails.`date_sent_received` DESC LIMIT 1: MySQL error 1054: Unknown column 'emails.date_sent_received' in 'field list'

It looks the indexes are changed and so this might be breaking the query for subpanels in Contacts module.
Path:
Core\core\modules\Contacts\Statistics\ContactLastTouchPoint.php
$queries[4] & $queries[5]

There are indexes difference in this file in 8.6.2 and 8.7. The $queries list has different indexes 8.7 and 8.6.2 in ContactLastTouchPoint.php but the order of subpanels in subpaneldefs.php in two versions is not different.
Changing the indexes of $queries in ContactLastTouchPoint in 8.7 similar to 8.6.2 fixed the issue in my suite8.7 installation.
changed the above indexes as $queries[5] & $queries[6] in 8.7 in the same file.

I am not sure if this is the correct fix, or I am missing something.

Possible Fix

Reverting the indexes $queries array order $queries[4] & $queries[5] by $queries[5] & $queries[6] reectively.
in Core\core\modules\Contacts\Statistics\ContactLastTouchPoint.php

Steps to Reproduce the Issue

1. Log into the suite 8.7
2. Click on 'Contacts' module menu
3. Open a contact detail view
4. Check for the error in suitecrm.log file
...

Context

No response

Version

8.7

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

MariaDB, PHP 8.2

Operating System and Version

Windows

@gmcodentech gmcodentech added the Type: Bug Something isn't working label Oct 14, 2024
@johnM2401 johnM2401 added Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Severity: Moderate Minor Impact labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Severity: Moderate Minor Impact Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants