CRM-15030 Custom fields in Views display incorrectly or not at all, depending on label

    Details

    • Documentation Required?:
      None

      Description

      Hi,

      I've encountered issues when using views to display custom fields where amendments have been made to the field labels (in the views UI).

      Using Civi 4.4.6, Drupal 7.29, Views 7.x-3.8 with a checkbox field...

      Label same as Civi field label: data displays (correct).
      Label disabled: data displays without comma separation (incorrect).
      Label different from Civi field label: nothing displays (incorrect).

      I've also tested on a different site using Civi 4.4.6, Drupal 7.27, Views 7.x-3.8 with a contact reference field...

      Label disabled: displays contact ID instead of name (incorrect).
      Label different from Civi field label: nothing displays (incorrect).
      Label same as Civi field label: contact name displays (correct).

      This second site also shows similar problems to the first site with alphanumeric/checkbox and yes-or-no/radio fields.

      The second site works correctly on the live version on Civi 4.3.8, Drupal 7.29, Views 7.x-3.8.

      I've been unable to replicate the issues on the demo site as I don't have access to views and have already posted on the community forum at: http://forum.civicrm.org/index.php/topic,33617.0.html

      Thanks.

        Attachments

          Issue Links

            Activity

            [CRM-15030] Custom fields in Views display incorrectly or not at all, depending on label
            Dave Jenkins added a comment -

            I've tracked down the cause, by replacing civicrm/drupal/modules/views/ with earlier versions. The problem was introduced between 4.4.3 and 4.4.4 and the culprit appears to be this change:

            fixes for CRM-12956, bug in calculating custom field id
            https://github.com/civicrm/civicrm-drupal/commit/a4deb15852209ae55f41a988d7c88a90eb1fb43e

            Replacing drupal/modules/views/civicrm/civicrm_handler_field_custom.inc with the version from 4.4.3 fixes the problem.

            CRM-12956 doesn't really make clear what the issue is that the above change was trying to fix, but it evidently relies on the field label in Views being the same as the Civi custom field label, which is not generally true.

            Cheers,

            Dave

            David Greenberg added a comment -

            Dave - would be great if you could figure out the best approach for looking up the field id and submit a patch for 4.5.

            Dave Jenkins added a comment -

            Hi Dave,

            What makes this trickier is that CRM-12956 doesn't describe how to replicate the issue that the code change there was trying to fix. In our testing, the 4.4.3 version works fine and the 4.4.4 one is broken. If we had steps to replicate the problem CRM-12956, that might help to move things forward.

            I'm away now until Monday.

            Hope all's well in San Francisco.

            Cheers,

            Dave

            Kurund Jalmi added a comment -

            Stewart / Dave J,

            Can you please check if this works: https://github.com/civicrm/civicrm-drupal/pull/154

            Dave Jenkins added a comment -

            Hi Kurund,

            Yes, that patch is working here.

            Thanks,

            Dave

              People

              • Assignee:
                Kurund Jalmi
                Reporter:
                Stewart Dorgan

                Dates

                • Created:
                  Updated:
                  Resolved: