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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Auto-changing contact type weirdness :S
Pages: [1]

Author Topic: Auto-changing contact type weirdness :S  (Read 479 times)

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Auto-changing contact type weirdness :S
June 13, 2014, 02:04:57 am
+---------------------+-------------+----------------+----------------------------------------+
| log_date            | log_user_id | log_action     | contact_sub_type                       |
+---------------------+-------------+----------------+----------------------------------------+
| 2012-11-16 11:42:20 |        7768 | Initialization | SchoolFurther_Education_Institution |
| 2014-05-29 16:29:31 |       38748 | Update         | Further_Education_Institution        |
| 2014-05-31 23:31:13 |       97799 | Update         | SchoolFurther_Education_Institution |
| 2014-06-03 14:56:36 |       38748 | Update         | Further_Education_Institution        |
| 2014-06-05 11:59:33 |        NULL | Update         | SchoolFurther_Education_Institution |
+---------------------+-------------+----------------+----------------------------------------+


This school is meant to be of type Further_Education_Institution, yet it somehow keeps reverting back to SchoolFurther_Education_Institution.

The third instance is someone who is a logged in user who is not meant to be able to change the contact's type. The fifth instance is bizarre - how can a change be made by someone who isn't logged in?

Is there a way of, when data is accessed, that somehow mutating the organisation's type? Or is the only way that this can be happening in our code somewhere there's some borky stupid hack to result in this insanity?

Thanks,

JohnFF
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Auto-changing contact type weirdness :S
June 13, 2014, 10:59:40 am
It would be good to check what are different ways in your install for updating contact information. May be that will give a clue.

Kurund
Found this reply helpful? Support CiviCRM

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: Auto-changing contact type weirdness :S
June 18, 2014, 04:32:01 am
It turns out that this was caused by our webform settings!

If you set a contact's subtype for a contact that you're creating, it rightly creates the new contact as having that contact subtype.

What no one here realised is that it will adjust referenced existing contacts to match the types selected.

We have an Individual subtype Student, and two Organisation subtypes (Further Education Institution and School), either of which a Student can sign up to.

So if a Student signs up to a Further Education Institution, and you need the School to be referenced on the Student's custom field, then you might well set the webform contact's Organisation type to be School and Further Education Institution (as it can be either).

However, if the Student signs up to a Further Education Institution, then the webforms will set the related organisation subtypes to be School and Further Education Institution!
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Auto-changing contact type weirdness :S

This forum was archived on 2017-11-26.