MySQL error 1054: Unknown column even after repair and rebuild

Hi,

I always encounter this issue in the suitecrm error log:

MySQL error 1054: Unknown column ā€˜contacts.lead_source’ in ā€˜where clause’

I’ve already done Quick Repair and Rebuild many times and it always shows Database tables are synced with vardefs

Can anyone please guide me how to resolve this issue?

This topic may help you debug your issue: https://suitecrm.com/forum/bug-tracker/885-create-pdfs-no-longer-working#3686

Hi Will,

I checked the folder but it doesn’t have those files.

these are not existing:

custom/Extension/modules/Opportunities/Ext/Vardefs/sugarfield_textarea_c.php
custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_facebook_username_c.php

Hi Will,

This is what happening please see attached screenshot.

I have managed to add the contact lead source in the search view of meeting.

However, I just can’t search the list by lead source. It always says ā€œNo result foundā€.

I checked the error log, and had this: MySQL error 1054: Unknown column ā€˜contacts.lead_source’ in ā€˜where clause’
even after a successful repair and rebuild

custom vardef_ext_lead_source.php:

$dictionary[ā€œMeetingā€][ā€œfieldsā€][ā€œlead_sourceā€]= array(
ā€˜name’ => ā€˜lead_source’,
ā€˜vname’ => ā€˜LBL_LEAD_SOURCE’,
ā€˜query_type’ => ā€˜default’,
ā€˜source’ => ā€˜non-db’,
ā€˜type’ => ā€˜enum’,
ā€˜options’ => ā€˜lead_source_dom’,
ā€˜studio’ => array(ā€˜searchview’=>true,ā€˜visible’=>false),
);

custom SearchFields.php:

ā€˜lead_source’ =>
array (
ā€˜query_type’ => ā€˜default’,
ā€˜db_field’ =>
array (
0 => ā€˜contacts.lead_source’,
),
),

custom searchdefs:

ā€˜lead_source’ =>
array (
ā€˜type’ => ā€˜enum’,
ā€˜default’ => true,
ā€˜studio’ => ā€˜visible’,
ā€˜label’ => ā€˜LBL_LEAD_SOURCE’,
ā€˜width’ => ā€˜10%’,
ā€˜name’ => ā€˜lead_source’,
),

Am I missing something?

Hi,

It is missing a join clause… please guide me how to resolve this

error log:

Query Failed: SELECT meetings.id ,meetings_cstm.meetingtype_c, meetings.date_start , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , ā€˜Users’ assigned_user_name_mod, meetings.parent_id , meetings.parent_type , meetings.date_entered , jt1.user_name created_by_name , jt1.created_by created_by_name_owner , ā€˜Users’ created_by_name_mod, meetings.assigned_user_id FROM meetings LEFT JOIN meetings_cstm ON meetings.id = meetings_cstm.id_c LEFT JOIN users jt0 ON meetings.assigned_user_id=jt0.id AND jt0.deleted=0

AND jt0.deleted=0 LEFT JOIN users jt1 ON meetings.created_by=jt1.id AND jt1.deleted=0

AND jt1.deleted=0 where ((contacts.lead_source in (ā€˜Canvassing’))) AND meetings.deleted=0 ORDER BY meetings_cstm.meetingtype_c ASC LIMIT 0,21: MySQL error 1054: Unknown column ā€˜contacts.lead_source’ in ā€˜where clause’

Hi,

Any idea please?

Need some help on this. Can’t figure out what I am missing.

Any help please? I can’t seem to move on with this issue. :frowning:

Any update please?

Hi,

Maybe ; create manually in leads table this fields with SQL manager or another program.

lead_source VARCHAR 100 allow null

Regards

Hi,

its already present in the table of leads.

Any idea why I keep on encountering the issue?

In meeting module, it is missing a join clause. Any solution please?

Hi All,

Still stuck on this issue… :unsure: :unsure: :unsure:

I will really appreciate any idea…

Hum,
If i understand, you will research contacts in Meetings ?

For me, it’s hard to resolve this becauses :

Meetings have a ā€œrelate fieldā€ to many modules … : theses 2 fields are parent_id and parent_type
The contacts subpanel is not a contacts subpanel but come from : meetings_contacts who store : Accept/Decline Status and the id of the contact.

I have no skill for find a solution for that

Good luck.
’

issue resolved

Could you share the solution so that, if others experience the same issue, they may try it?

Thanks

by setting the ā€˜unified_search’ => true, of lead_source in vardefs and adding the column contact in the list view via studio resolved this issue