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

Drupal Views: custom fields on address do not work

    Details

      Description

      See http://forum.civicrm.org/index.php/topic,28017.0.html :

      Tested in 4.3.beta2:

      Custom fields on Address do not work in Drupal Views. The fields are available to select in the Views UI but I found two problems that prevent data being accessed for these fields:

      1. Join to the wrong table. Here's an example excerpt from the SQL generated by Views:

      LEFT JOIN

      {civicrm_value_additional_address_fields_10}

      civicrm_value_additional_address_fields_10 ON civicrm_contact.id = civicrm_value_additional_address_fields_10.entity_id

      however this custom field set extends Address, so its entity_id values are address ids, not contact ids. Double-checking: this from "show create table civicrm_value_additional_address_fields_10":
      CONSTRAINT `FK_civicrm_value_additional_address_08dd2bafb6164f15` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_address` (`id`) ON DELETE CASCADE

      2. Need to be able to select Location Type when setting up the field, as for standard address fields.

      Cheers,

      Dave

        Attachments

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              davej Dave Jenkins
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: