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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Phonenumber not updated
Pages: [1]

Author Topic: Phonenumber not updated  (Read 664 times)

BasH

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.3.3. revision ce35dedb59
  • CMS version: Drupal 6.29
  • MySQL version: 5.0.8-dev - 20102224
  • PHP version: 5.3.11
Phonenumber not updated
March 09, 2012, 12:16:08 am
The following error is returned when I try to update a phonenumber in a webform.
Is the module expecting more phonenumbers while there is only one for this contact?
(the values are correct, the same as in my database)

The CiviCRM "phone create" API function returned the error: "There is no option group phone_type in CiviCRM, can not create phone." when called by line 235 of C:\Program Files\BitNami Drupal 6 Stack\apps\drupal\htdocs\sites\all\modules\webform_civicrm\webform_civicrm_utils.inc with the following parameters: "Array ( [phone_type_id] => 1 [location_type_id] => 1 [phone] => 0715283440 [contact_id] => 263 [id] => 177 [is_primary] => 1 [check_permissions] => [version] => 3 ) "

As you can see I'm new here. Is this the right place to post? I posted this in Drupal.org and they gave me the suggestion to post it here (somewhere), with the remark that it could be a configuration item in my database. But I can change the phonenumber in Civicrm and it also looks like this error doesn't show for all contacts(!?)
« Last Edit: March 09, 2012, 03:37:52 am by BasH »
kind regards, Bas

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Phonenumber not updated
March 09, 2012, 10:20:27 am
I was thinking this was an api/core issue and not a webform issue. Note the (perfectly reasonable) params given to the api function and the odd error message returned.
Try asking your question on the new CiviCRM help site.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Phonenumber not updated
March 09, 2012, 03:44:54 pm
Hi,

So it seems to mean than phone_type_id 1 doesn't exist (or is invalid, or the api checking the phone type is broken, or a ghost in the machine)

Anyway

1) the error message is not clear enough
2) that's a performance hit to check EVERY time if the type exists. We discussed it recently with Erik and the proper approach is to create no matter what, and if there is a coherency error at the db level, throw an error and then only do a more indept error checking.
3) Patch more than welcome: api/v3/Phone.php check out the latest blog post from eileen, the generic_get & create_spec solution would fit really nicely here
4) Did I mention patches are welcome? ;)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

BasH

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.3.3. revision ce35dedb59
  • CMS version: Drupal 6.29
  • MySQL version: 5.0.8-dev - 20102224
  • PHP version: 5.3.11
Re: Phonenumber not updated
March 12, 2012, 08:23:42 am
Don't know which blog you mean, found dozens of posts from Eileen().
What I did is: I removed the check of the option type in phone.php (because the option type does exist..), then I got the error "Location_type_id does not exist, could not create phone"(also not true by the way), so I also removed that check.
Then my phone number was correctly updated...
kind regards, Bas

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Phonenumber not updated

This forum was archived on 2017-11-26.