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

Drupal views: relationship type a-b empty

    Details

      Description

      Steps to reproduce:

      1. Create a Drupal view of civicrm_contacts
      2. Add field "CiviCRM Relationships: Relationship Type A-to-B"
      3. Observe an error reporting "unsupported operand type"
      4. Observe empty relationship type fields even for those contacts with valid relationships

      There are two issues here. The first is that civicrm_handler_field_relationship_type.inc's construct() method does not first call it's parent construct() method. This is causing the unsupported operand types error as an options array is not properly initialized without it.

      Secondly, when this class is initialized it attempts to load and cache all relationship type names. However, it was attempting to access the relationships using the array key 'label_a_b' which does not exist. It therefore caches no relationship types at all.

      Please see attached patch for relevant fixes.

        Attachments

          Activity

            People

            • Assignee:
              pittstains Frank J. Gómez
              Reporter:
              torrance123 Torrance
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: