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

Multiple Custom Field with file type display and edit

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      issue 1 - Multiple custom field File display

      • Create a custom set with following options

      – Used For - Contacts
      – Does this Custom Field Set allow multiple records? - ticked
      – Display Style - Tab

      • Create a custom field for above set with following option
        • Data and Input Field Type - File
      • Attach more than one file to above custom field
      • Check display after save

      You will see all attached files having same name though attached different files and links will be missing to those files too.

      Issue 2 - Edit multiple custom field

      • Click edit for above custom field

      It shows only one file information. It showed all files information in previous version of CiviCRM.

      • Click add Another button
        It brings another attached file information instead to attach new file screen. If we have 30 files attached for this custom field then we have to click 30 times this add button to attach new file

      Fixes-

      Issue 1 - multiple custom field file display

      Added following code to Line 1928 in CRM / Core / BAO / CustomGroup.php

      if (strtolower($properties['data_type']) == 'file' &&
      !empty($values['data']) && !empty($values['fid']))

      { $disValue = CRM_Core_BAO_CustomField::getFileURL($entityId, $properties['id'], $values['fid']); $details[$groupID][$values['id']]['fields'][$k]['field_value'] = $disValue['file_url']; }

      issue 2 - Edit multiple custom field

      Replaced following tpl file with 4.6 version of civicrm
      templates\CRM\common\customData.tpl

      However replacing this breaks in other part of civi.
      Example - add new contribution

      Added condition to pick 4.6 version of above tpl when viewing multiple custom fields otherwise to pick 4.7 version of tpl

        Attachments

        1. custom_field_Display.png
          30 kB
          Kajakaran Balakrishnan
        2. custom_field.png
          6 kB
          Kajakaran Balakrishnan
        3. custom_group_setting.png
          32 kB
          Kajakaran Balakrishnan
        4. edit_custom_field.png
          14 kB
          Kajakaran Balakrishnan

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Kajakaran Kajakaran Balakrishnan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: