Body: <p>If an extended search result shows a group of people with different phone number types as primary in some cases contacts a shown with the phone number of other contacts.</p>
  
  <p>The pattern is as follows:
  Start out with an alphabetical ascending list (makes it easier to find the pattern)</p>
  
  <p>We need to groups of contacts:
  a) contacts that have a primary number of type 'mobile' set (no matter if private or office)
  b) contacts that have a primary number of type 'phone' set (no matter if private or office)</p>
  
  <p>If a contact of group a) directly preceeds contacts of group b) all contacts of group b) are wrongly assigned with the number of contact a) until another contact of group a) is in the list - which than has it's correct phone number set.</p>
  
  <p>meaning we eg. see a pattern like:</p>
  
  <p>id 1 - primary of type phone - number 1
  id 2 - primary of type mobile - number 1
  id 3 - primary of type mobile - number 1
  id 4 - primary of type mobile - number 1
  id 5 - primary of type phone - number 2
  id 6 - primary of type phone - number 3
  id 7 - primary of type mobile - number 3
  ...</p>
  
  <p>and so on.. I could not see a pattern in terms of times repeating a certain number, as far as I could test it the problem exclusively depends on the type of phone number made primary..</p>
  
  <p>Has anybody noticed this behaviour before? Can anybody help reproducing this behaviour on a new/demo installation?</p>
  
  <p>Environment information</p>
  
  <p>Browser: Firefox 73.0.1 (64-Bit) Ubuntu 19.10
  CiviCRM: Master/5.20.0
  PHP: 7.2
  CMS: Drupal 7.68
  Database: MariaDB 10.1
  Web Server: Apache 2.4</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-12T18:20:38.153Z
Comments.Text: I've heard of a similar error in an older version of CiviCRM.  Could you please edit your question to indicate what version you're using?  The version should be in the footer of any CiviCRM page.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-23T14:31:28.587Z
Comments.Text: sorry, that i left it out. Updated the description - version is 5.20.0
Comments.UserDisplayName: PhilT
Tags: <drupal><sms>
Title: Send SMS shows wrong numbers
ThreadText: # Send SMS shows wrong numbers
  
  (Asked by: username_0 on 2020-03-12)
  
  If an extended search result shows a group of people with different phone number types as primary in some cases contacts a shown with the phone number of other contacts.
  
  The pattern is as follows:
  Start out with an alphabetical ascending list (makes it easier to find the pattern)
  
  We need to groups of contacts:
  a) contacts that have a primary number of type 'mobile' set (no matter if private or office)
  b) contacts that have a primary number of type 'phone' set (no matter if private or office)
  
  If a contact of group a) directly preceeds contacts of group b) all contacts of group b) are wrongly assigned with the number of contact a) until another contact of group a) is in the list - which than has it's correct phone number set.
  
  meaning we eg. see a pattern like:
  
  id 1 - primary of type phone - number 1
  id 2 - primary of type mobile - number 1
  id 3 - primary of type mobile - number 1
  id 4 - primary of type mobile - number 1
  id 5 - primary of type phone - number 2
  id 6 - primary of type phone - number 3
  id 7 - primary of type mobile - number 3
  ...
  
  and so on.. I could not see a pattern in terms of times repeating a certain number, as far as I could test it the problem exclusively depends on the type of phone number made primary..
  
  Has anybody noticed this behaviour before? Can anybody help reproducing this behaviour on a new/demo installation?
  
  Environment information
  
  Browser: Firefox 73.0.1 (64-Bit) Ubuntu 19.10
  CiviCRM: Master/5.20.0
  PHP: 7.2
  CMS: Drupal 7.68
  Database: MariaDB 10.1
  Web Server: Apache 2.4
  
  **Tags:** drupal, sms
  
  > **Comments:**
  > **username_1**: I've heard of a similar error in an older version of CiviCRM.  Could you please edit your question to indicate what version you're using?  The version should be in the footer of any CiviCRM page.  
  > **username_0**: sorry, that i left it out. Updated the description - version is 5.20.0  
  
  ---
  
  ## 0 answers
  
  