I've used Civix to make a duplicate of the default Relationship report, and I'd like to extend it to show basic information for a third contact. So we have Contact A and can specify criteria about the relationship with Contact B, and now I'd also like to specify criteria about the relationship with Contact C, if there is such a contact.
Civix helped generate a custom report extension and when I edit the PHP file, I can figure out how to duplicate some lines to produce the interface for the new columns and filters for Contact C.
The trouble I am having is in figuring how to properly name the duplicated array keys and variables so that I don't get "Unknown column" or similar SQL errors when I try to run it.
The goal is to be able to end up with a simple list based on a primary contact, showing (for example) their spouse's name and their child's name (given a relationship of "Spouse of" and "Child of"). If they have no spouse/child relationships then those columns would be blank.
Rather than hardcode SQL I would like to use the interface to allow selections of relationships for flexibility (and in case anyone else would have a use for it) but I am having a little difficulty as it is my first solid attempt to make a custom report with Civix.
At the moment these particular lines of the extension seem to be causing ** Unknown column 'relationship_type_c_civireport.label_a_c' in 'field list']
and DB Error: no such field
errors. If anyone has a pointer, I would appreciate it!