Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3099

Batch Update by Profile -> Copy values to all rows does not support multiple checkbox fields

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      The javascript for "copy values to all rows" (copyValues function) fails with a javascript error when used on a profile containing a custom data field that has multiple checkboxes.

      copyValues defined in templates/CRM/Contact/Form/Task/BatchUpdateProfile.tpl assumes the presence of a field with a name like "field[1234][custom_12]" for a contact_id 1234 and a multi-checkbox field which is custom_12. This fails with an error if the multi checkbox fields are "red", "blue", "green" then the field names will be "field[1234][custom_12][red]", etc.

      One fix is to scan the first row of the table for inputs with a partial name match against "field[1234][custom_12]", then iterate through the matching inputs and copy values from there.

      See also CRM-1554 (similar but relates to date fields)

        Attachments

        1. BatchUpdateProfile.tpl
          6 kB
          Chris Burgess
        2. copyValues.patch
          3 kB
          Chris Burgess

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              xurizaemon Chris Burgess
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: