CRM-19222 Data too long on export including custom field

    Details

    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      When doing an export that includes an alphanumeric multiple-choice custom field that has a database field length, the temp table for the export will set the column length to that field length value.

      In the case of a field that has very short value length but reasonably long labels, you can have a "data too long" database error when the export loads values into the temp table. An export should have the label in the field, not the value, and even though the database field length might limit the values, the labels can be up to 255 characters as the label field in civicrm_option_value is varchar(255).

        Attachments

          Activity

          [CRM-19222] Data too long on export including custom field
          Andrew Hunt added a comment -

          I made the field length 255 at a minimum.

          This fixes the issue on the 4.6 site that encountered this problem initially. I also tested against 4.7, but it appears that the failure in 4.7 is more graceful: the export just truncates the label at the field length. Still, this change makes the entire label display.

          Yashodha Chaku added a comment -

            People

            • Assignee:
              Yashodha Chaku
              Reporter:
              Andrew Hunt

              Dates

              • Created:
                Updated:
                Resolved: