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 Profiles (Moderator: Dave Greenberg) »
  • Profile behavior when fields left empty
Pages: [1]

Author Topic: Profile behavior when fields left empty  (Read 1134 times)

TLange

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • President of California Clean Money Campaign
    • California Clean Money Campaign
Profile behavior when fields left empty
August 31, 2011, 10:37:20 pm
We've been having the following problem for years using profiles with anonymous users -- when we include a field (like phone number or any other field) in a profile on an an event registration or contribution page, if the user leaves it blank, it overwrites whatever value was stored for that contact in the field.

Since we don't necessarily want to require them to give e.g. their phone number, but would like them to give it if they're willing to, this is a major problem.

dharmatech posted about the same problem back in 2009 but didn't get an answer (http://forum.civicrm.org/index.php/topic,7209.msg31664.html#msg31664), and it still seems to be happening.  Is there a workaround to this problem now, or any way to get it on the queue of issues to fix?

Thanks,

- Trent

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Profile behavior when fields left empty
September 01, 2011, 09:45:08 am

1. you could potentially set your strict dedupe rule that ensure that u always create new contacts rather than update an existing contact. This will ensure that you merge contacts on a regular basis and decide which information to keep / over-write

2. does phone number get blanked out even if not present in the profile?

3. Would be great if you can get your org to help develop and improve this aspect of CiviCRM. Would be good for the code to be able to handle different cases based on some global settings. We'll also need to handle the case when someone does want an org to delete their email/phone

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

TLange

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • President of California Clean Money Campaign
    • California Clean Money Campaign
Re: Profile behavior when fields left empty
September 02, 2011, 08:26:44 am
Thanks for the answer.  Using the strict de-dupe rule to make sure that it always creates a new contact would work, if a little painfully.

Are there actually cases in which groups would want people's email/phone to be deleted if people left them blank on event signup or contributions?

What about just changing the behavior so that it works the same as importing, i.e. that if the field is blank, it doesn't overwrite the current value, but if the field says "Null" (and maybe "None"?), it erases it?

(I could imagine asking our volunteer programmer to do that, though wonder how many layers there would be with custom fields applying to different types of contacts, etc.)

- Trent

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Profile behavior when fields left empty
September 02, 2011, 09:57:17 am

Cool. would be great if you can ask your volunteer programmer to take a look into it. He could peek into the import code and see how it handles the fill vs update

the volunteer should ping us on irc if they get stuck and/or need some clarification

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

LouieGeetoo

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.08
  • CMS version: Drupal 7.12
  • MySQL version: 5.1.54-community-log
  • PHP version: 5.2.8
Re: Profile behavior when fields left empty
May 23, 2012, 01:29:46 pm
So... here we are a year later. I'm on 4.0.8 and seeing this behavior. I didn't even realize this was happening and we're using HTML Snippets from profiles on a number of pages for mailing list subscriptions, with optional fields that get blanked out if left empty upon submission. Especially with HTML Snippets this most certainly should not be the default behavior. Any chance at a solution? Where in the code should I go poking around if I'd like to try to fix it myself?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Profile behavior when fields left empty
May 23, 2012, 08:46:05 pm

might want to start off by reading:

http://book.civicrm.org/developer/

Most of the code involved with this is: CRM/Contact/BAO/Contact*

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

LouieGeetoo

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.08
  • CMS version: Drupal 7.12
  • MySQL version: 5.1.54-community-log
  • PHP version: 5.2.8
Re: Profile behavior when fields left empty
May 24, 2012, 06:02:08 am
Thanks, Lobo. I'll take a look.

(And thanks for all your great work.)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Profile behavior when fields left empty
May 24, 2012, 12:45:07 pm
Quote
Are there actually cases in which groups would want people's email/phone to be deleted if people left them blank on event signup or contributions?
Yes I can think of some - eg a person wants to remove their Work phone as they aren't there any more or don't want it on record - same for email etc.
Not sure how you can do that without having a 'clear' button next to those fields which would mean that 'if field is cleared then update DB to empty'
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Profile behavior when fields left empty

This forum was archived on 2017-11-26.