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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Adding a new preferred language breaks things
Pages: [1]

Author Topic: Adding a new preferred language breaks things  (Read 473 times)

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
Adding a new preferred language breaks things
January 24, 2014, 03:34:39 pm
hey folks,

i went to drupal.demo.civicrm.org and added Mandarin to the list of Preferred Language Options. i then went to a record and tried to use that language option in the Preferred Language field.

when i click the Edit button and choose Mandarin and Save, i get:

Code: [Select]
Database Error Code: Data too long for column 'preferred_language' at row 1, 1406
Additional Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => UPDATE  civicrm_contact  SET contact_type = 'Individual' , contact_sub_type = NULL , do_not_email = 0 , do_not_phone = 0 , do_not_mail = 0 , do_not_sms = 0 , do_not_trade = 0 , is_opt_out = 0 , external_identifier = NULL , sort_name = 'Test, Test' , display_name = 'Test Test' , nick_name = NULL , preferred_communication_method = '' , preferred_language = 'Mandarin' , preferred_mail_format = 'Both' , source = NULL , first_name = 'Test' , middle_name = NULL , last_name = 'Test' , prefix_id = NULL , suffix_id = NULL , email_greeting_id = 1 , email_greeting_custom = NULL , postal_greeting_id = 1 , postal_greeting_custom = NULL , addressee_id = 1 , addressee_custom = NULL , job_title = NULL , gender_id = NULL , birth_date = NULL , is_deceased = 0   WHERE (  civicrm_contact.id = 203 )   [nativecode=1406 ** Data too long for column 'preferred_language' at row 1]
    [type] => DB_Error
    [user_info] => UPDATE  civicrm_contact  SET contact_type = 'Individual' , contact_sub_type = NULL , do_not_email = 0 , do_not_phone = 0 , do_not_mail = 0 , do_not_sms = 0 , do_not_trade = 0 , is_opt_out = 0 , external_identifier = NULL , sort_name = 'Test, Test' , display_name = 'Test Test' , nick_name = NULL , preferred_communication_method = '' , preferred_language = 'Mandarin' , preferred_mail_format = 'Both' , source = NULL , first_name = 'Test' , middle_name = NULL , last_name = 'Test' , prefix_id = NULL , suffix_id = NULL , email_greeting_id = 1 , email_greeting_custom = NULL , postal_greeting_id = 1 , postal_greeting_custom = NULL , addressee_id = 1 , addressee_custom = NULL , job_title = NULL , gender_id = NULL , birth_date = NULL , is_deceased = 0   WHERE (  civicrm_contact.id = 203 )   [nativecode=1406 ** Data too long for column 'preferred_language' at row 1]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE  civicrm_contact  SET contact_type = 'Individual' , contact_sub_type = NULL , do_not_email = 0 , do_not_phone = 0 , do_not_mail = 0 , do_not_sms = 0 , do_not_trade = 0 , is_opt_out = 0 , external_identifier = NULL , sort_name = 'Test, Test' , display_name = 'Test Test' , nick_name = NULL , preferred_communication_method = '' , preferred_language = 'Mandarin' , preferred_mail_format = 'Both' , source = NULL , first_name = 'Test' , middle_name = NULL , last_name = 'Test' , prefix_id = NULL , suffix_id = NULL , email_greeting_id = 1 , email_greeting_custom = NULL , postal_greeting_id = 1 , postal_greeting_custom = NULL , addressee_id = 1 , addressee_custom = NULL , job_title = NULL , gender_id = NULL , birth_date = NULL , is_deceased = 0   WHERE (  civicrm_contact.id = 203 )   [nativecode=1406 ** Data too long for column 'preferred_language' at row 1]"]
)

when i try to do it on the Summary page itself, i get
"Network Error. Unable to reach the server. Please refresh this page in your browser and try again."

has any one else seen this before?

--josue

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Adding a new preferred language breaks things
January 24, 2014, 06:00:53 pm

That column has a length of 5 characters only. When u added a new language (mandarin), it used the label as the value which overflowed the column name etc

ideally we should truncate and ensure that the value is 4 characters only. Would help if u can get jamie or someone from PTP to fix this issue

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Adding a new preferred language breaks things
January 29, 2014, 08:58:21 am
okay, more investigation lead me to discover two different data entry screens:

civicrm/admin/options/languages?group=languages&reset=1 is available from the menu, under Administer -> Localization, called Preferred Language Options. This interface only shows you the Label.

If you go to Administer -> System Settings -> Option Groups, scroll down to Languages and click on Options, you also get to a list of the Languages but with a much more useful interface. Here, when you Edit or Add you see Label, Value and Name. The Name field is the one that you need for importing.

This is the page that one should use to update the list of Preferred Languages.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Adding a new preferred language breaks things

This forum was archived on 2017-11-26.