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

Errors using city/suburb, zip/postcode fields in Drupal views

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.0
    • Component/s: None

      Description

      If you create a Drupal view based on civicrm_contacts and attempt to add in any field that makes use of the civicrm_handler_field_location handler, you will get this error when attempting to configure the field:

      Path: /admin/structure/views/view/retretrdgdfgfdgsd/preview/page/ajax
      StatusText: OK
      ResponseText: Fatal error: Unsupported operand types in sites/all/modules/views/handlers/views_handler_field.inc on line 1039

      The handler is overriding the parent's consruct() method but isn't calling parent::construct() in the course of this method. This is causing various instance variables to be incorrectly initialized.

      Additionally, once this bug is corrected, address fields that rely on civircrm_handler_field_address (which sublcasses location) cause page execution to fail, with the following error:

      Fatal error: Call to a member function use_group_by() on a non-object in sites/all/modules/views/includes/handlers.inc on line 296

      This is caused by a call in civicrm_handler_field_address to $this->ui_name() before (from what I am guessing) handlers are properly initialised. Explicit setting of the label isn't necessary, so this code can simply be removed.

      Please see attached patch.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              torrance123 Torrance
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: