CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.2 Release Testing »
  • Issues with older custom data group fields
Pages: [1]

Author Topic: Issues with older custom data group fields  (Read 3317 times)

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Issues with older custom data group fields
September 15, 2010, 03:40:18 pm
Custom data groups generated back in the days of 1.7 - 1.9 yore were given the table prefix "custom_value_".

Later this became "civicrm_value_" and the ERD smiled upon them mightily.

These older tables were not renamed as the years passed, and now some hard-coded instances of "civicrm_value" have sneaked into the codebase.

I filed a report at http://issues.civicrm.org/jira/browse/CRM-6828 regarding this, with patches to accommodate the older table prefix syntax for those older sites.

If you see odd SQL errors where reports or dedupe rules complain about missing / non-existent fields, and you see field names starting with "alue" instead of "value" in the SQL, this is probably why. Eg, our SQL error was thrown by this code -

Code: [Select]
   SELECT SQL_CALC_FOUND_ROWS
          contact_civireport.display_name as civicrm_contact_display_name,
          contact_civireport.id as civicrm_contact_id,
          address_civireport.street_address as civicrm_address_street_address,
          address_civireport.city as civicrm_address_city,
          address_civireport.country_id as civicrm_address_country_id 
     FROM civicrm_contact contact_civireport
LEFT JOIN civicrm_address address_civireport
       ON ( contact_civireport.id = address_civireport.contact_id AND address_civireport.is_primary = 1 )
    WHERE ( alue_1_Geography_civireport.Electorate IN ( 'Botany') ) AND contact_civireport.is_deleted = 0 
 GROUP BY contact_civireport.id
    LIMIT 0, 50

where the actual table.field is custom_value_1_Geography.Electorate (and is meant to be aliased to value_1_Geography_civireport.Electorate).
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.2 Release Testing »
  • Issues with older custom data group fields

This forum was archived on 2017-11-26.