2

On current CiviCRM demo site (4.6.10) if you

add a new location type, then populate a contact with an email address of that location type, then use Search builder to search for email address with location type, it gives error:

DB Error: syntax error

  • I think this is probably a bug. It doesn't matter if you create a new location type or use a pre-populated one. The sql has a column that doesn't exists and it's going against the wrong table. Here's the sql: SELECT DISTINCT UPPER(LEFT(contact_a.sort_name, 1)) as sort_name FROM civicrm_contact contact_a WHERE ( ( LOWER(Home-location_type.name) = '8' ) ) AND (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY UPPER(LEFT(contact_a.sort_name, 1)) asc [nativecode=1054 ** Unknown column 'Home-location_type.name' in 'where clause'" Can you file a bug? – Paul-Tahoe Oct 20 '15 at 0:48
  • Thanks Paul-Tahoe, I've submitted as a bug: issues.civicrm.org/jira/browse/CRM-17424 – AlanGallery Oct 20 '15 at 14:21
1

For completeness, my comment probably should have been an answer…

I think this is probably a bug.

It doesn't matter if you create a new location type or use a pre-populated one. The sql has a column that doesn't exists and it's going against the wrong table. Here's the sql:

SELECT DISTINCT UPPER(LEFT(contact_a.sort_name, 1)) as sort_name 
FROM   civicrm_contact contact_a 
WHERE  ( ( LOWER(Home-location_type.name) = '8' ) ) 
AND    (contact_a.is_deleted = 0) GROUP BY contact_a.id 
ORDER BY UPPER(LEFT(contact_a.sort_name, 1)) asc 

[nativecode=1054 ** Unknown column 'Home-location_type.name' in 'where clause'"

AlanGallery submitted a bug see comment above.

1

I have the same problem. I have some installations that work correctly and some that's don't work.

I made this patch, it's not a nice patch, becasuse it's not applied in CRM_Contact_Form_Search_Builder, but temporally works

https://github.com/rubofvil/civicrm-core/commit/facfa396891229eb914397eb4920e75b6abff4a2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.