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

"Primary" location type cause profile field value disappear when 2 field both Primary

    Details

      Description

      relate to #CRM-11644, Have reproduced on drupal.demo.civicrm.org, see attachment below.

      It's only affect when both location related field is primary. Such as phone, we have both mobile and house as primary field.

      The query builder will generate sql for both these field as
      ```sql
      AND `1-phone-1`.is_primary = 1
      AND `1-phone-2`.is_primary = 1
      ```

      Maybe because the condition will always get from this line at Contact/BAO/Query.php
      ```php
      foreach ($this->_returnProperties['location'] as $name => $elements) {
      $cond = self::getPrimaryCondition($elementType);
      ```
      github line: http://goo.gl/Eu6P7N

        Attachments

        1. CRM-14470.patch
          1 kB
          Jimmy Huang
        2. profile-problem1.png
          28 kB
          Jimmy Huang
        3. profile-problem2.png
          15 kB
          Jimmy Huang
        4. profile-problem3.png
          19 kB
          Jimmy Huang

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              jimyhuang Jimmy Huang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: