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

Show-hide fails when viewing Custom Data for Contact in TAB mode

    Details

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

      Description

      The template for viewing custom data from Contact >> View >> <custom group tab> winds up showing both the "show" blocks and "hide" blocks because the template (templates/CRM/Contact/Page/View/CustomData.tpl) invokes the function on_load_init_blocks() which is defined in Common.js - BUT that file is not available to any of the child contentPanes.

      To recreate using sample data - modify the Setting for the sample "Constituent Info" custom data group so that Display is "Tab" instead of inline. Then browse to a contact record and hit that tab. You'll see both the show and hide div's (regardless of how "Collapse on Initial Display" is set.

      If you bring up that pane as a snippet - you can see the Javascript error - function is not defined - for on_load_init_blocks:
      http://<yoursite>/drupal/civicrm/contact/view/cd?reset=1&gid=1&cid=102&snippet=1&selectedChild=custom_1

      I tried to fix this by adding a line in the tpl to include Common.js. That works for the "snippet" view, but not in the tab - so I'm not sure how to get Common.js included in a contentPane scenario??

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: