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

Automated test picked up some inconsistencies on return in api WRT unique fields

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.0
    • Component/s: None
    • Labels:
      None

      Description

      So, the apply_filter function needs to anticipate that people might pass in unique field names & map those to field names.

      Where the values are being passed to QUERY object based functions they should be use unique names - ie. pledge_id not id, pledge_contribution_type_id not contribution_type_id - otherwise the query will be incorrect.

      Note that where the query object expects a unique name format - e.g. pledge_create_date but it has not been defined as having a unique field in the xml the field is currently completely unavailable via the API

      if (CRM_Utils_Array::value('pledge_create_date', $query->_returnProperties))

      { $query->_select['pledge_create_date'] = 'civicrm_pledge.create_date as pledge_create_date'; $query->_element['pledge_create_date'] = 1; $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1; }

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: