Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.8, 4.3.1
-
Fix Version/s: 4.3.4
-
Component/s: CiviContribute, Drupal Integration Modules
-
Labels:
Description
In CiviCRM View integration, there is a Views relationship, "CiviCRM Contacts: Drupal ID", that link the Drupal user table to the CiviCRM contact ID. This works properly if the base type of the View is "CiviCRM Contact", but it fails for chained relationships, such as: base type is "CiviCRM Recurring Contribution profile" (table civicrm_contribution_recur), plus a first relationship of "CiviCRM Recurring Contributions: Contact ID", plus a second relationship of "CiviCRM Contacts: Drupal ID" linked to the previous relationship. Setting up a View like this throws a "nonexistent column" db error, even without defining any fields based on the second relationship.
This is due to a bug in file civicrm_handler_relationship_contact2users.inc, function query(), in which the final call to add_relationship() was linking back to the wrong table for chained relationships. There was no ill effect if this relationship was the first link in the chain, which is why it wasn't immediately noticeable.
The attached patch fixes the issue for both D6 and D7.
Robert