CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Phone locations
Pages: [1]

Author Topic: Phone locations  (Read 566 times)

Katy J

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 4
    • Third Sector Design
Phone locations
January 21, 2015, 05:20:20 am
One for Coleman I guess
 
I have created a simple webform with 2 phone fields for people to update a phone number they want to have showing on a particular page.
Field 1: Phone Type = Phone /  Phone Location = Official
Field 2: Phone Type = Mobile /  Phone Location = Official

The fields are exposing the values of other numbers on the contact record like Phone / Home. And then new values in these fields are writing over the wrong values, not creating new instnaces of a phone field for the 'Official' numbers.

Do you think this is happening because 'Official' is a custom location type or is there something else wrong?

Thank you
Do what you love, it's your gift to the universe

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Phone locations
January 21, 2015, 05:56:11 am
This complaint has come up a few times. It's a feature or flaw of the webform module, depending on how you look at it.
When this module fetches addresses/phones/emails it fetches primary first and the rest come through in pretty random order. Location type is not accounted for. To maintain pairing btw location type and the entity in question, it's necessary to expose the location type field to the form, so that it can be set with the existing location type.
One step further in the workaround would be to change it to type "hidden" and give it a default value of "Official". This way new phones would get the "official" location type attached to them, but existing phones would keep the location type they already have.
Doesn't solve the problem of non-official phones being populated on the form though :(
Try asking your question on the new CiviCRM help site.

Katy J

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 4
    • Third Sector Design
Re: Phone locations
January 21, 2015, 06:25:53 am
Thanks a lot Coleman.

I have set it as user select, made the field hidden, with static options and left only 'Official' checked (and made default). That works for me. One question though - is there any case in which these location fields really do anything? Should they even be there as an option?
Do what you love, it's your gift to the universe

Katy J

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 4
    • Third Sector Design
Re: Phone locations
January 21, 2015, 06:43:23 am
I spoke too soon.

It's still exposing numbers that aren't 'Official' and then overwriting these values.
Plus I have 2 fields I'me using - one for Phone/Official and one for Mobile/Official and the checkbox (which I've set to private, but can see as an admin) on the Phone/Official isn't checked, despite setting it as the only option and the default.

Just to check I'm understanding what you suggested:

  • Add the 2 fields an in the Phone Location dropdown choose 'user select'
  • This creates 2 new fields (1 per Phone field) which you edit and make the field hidden, with static options and leave only 'Official' checked (and made default)

Seems this should work. Any thoughts?
« Last Edit: January 21, 2015, 06:53:16 am by Katy J »
Do what you love, it's your gift to the universe

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Phone locations
January 21, 2015, 06:53:00 am
If you are expecting that "Official" location type setting to prevent other phone numbers from being retrieved, sorry it does not.
When the webform-civicrm module fetches phones/emails/addresses from the api it just grabs them all without filtering on location type.
It seems that different orgs use location type in differnt ways (and many ignore it) so I've never known of one "right" way to solve this, so never have.
Try asking your question on the new CiviCRM help site.

Katy J

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 4
    • Third Sector Design
Re: Phone locations
January 21, 2015, 06:55:29 am
OK. Does that explain anything about why one of the fields refuses to be selected by default as well?
Do what you love, it's your gift to the universe

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Phone locations
January 21, 2015, 06:57:50 am
I'm not sure what the effect of setting a field to "private" is but suspect it will come through empty.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Phone locations

This forum was archived on 2017-11-26.