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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Fail to add Preferred Communication Method
Pages: [1]

Author Topic: Fail to add Preferred Communication Method  (Read 2965 times)

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Fail to add Preferred Communication Method
May 27, 2008, 03:12:54 am
Hi,

I am running CiviCRM 1.9.13019. I want to add a Preferred Communication Method but this gives me an error:

Code: [Select]
Sorry. A non-recoverable error has occurred.

is not of the type Int

I have enabled debug and this is the backtrace:

Code: [Select]
backTrace

/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/Error.php, backtrace, 255
/var/www/web11/web/sites/default/modules/civicrm/CRM/Utils/Type.php, fatal, 234
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/DAO.php, validate, 698
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/DAO.php, composeQuery, 663
/var/www/web11/web/sites/default/modules/civicrm/CRM/Utils/Weight.php, executeQuery, 269
/var/www/web11/web/sites/default/modules/civicrm/CRM/Utils/Weight.php, query, 170
/var/www/web11/web/sites/default/modules/civicrm/CRM/Utils/Weight.php, getMax, 189
/var/www/web11/web/sites/default/modules/civicrm/CRM/Admin/Form/Options.php, getDefaultWeight, 96
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/Form.php, setDefaultValues, 299
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/QuickForm/Action/Display.php, buildForm, 98
/var/www/web11/web/sites/default/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 195
/var/www/web11/web/sites/default/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 95
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/Controller.php, handle, 220
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/Page/Basic.php, run, 326
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/Page/Basic.php, edit, 171
/var/www/web11/web/sites/default/modules/civicrm/CRM/Admin/Page/Options.php, run, 170
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/Invoke.php, run, 702
/var/www/web11/web/sites/default/modules/civicrm/CRM/Core/Invoke.php, admin, 96
/var/www/web11/web/sites/default/modules/civicrm/drupal/civicrm.module, invoke, 319
, civicrm_invoke,
/var/www/web11/web/includes/menu.inc, call_user_func_array, 418
/var/www/web11/web/index.php, menu_execute_active_handler, 15

When I look at an older installation (1.7) I do see entries and am able to add one.

Also when I take the url to edit an entry from the 1.7 install:

civicrm/admin/options?group=preferred_communication_method&action=update&id=1&reset=1

and add it to my 1.9 install I am still able to edit one. So it looks like PCM's are avaiable in the database but Civicrm cant find them. It looks like an upgrade problem but im not sure.

Any solution?

Regards,

Carlo

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Fail to add Preferred Communication Method
May 27, 2008, 11:08:04 pm
I would recommend upgrading to 2.0 since its a bit difficult to debug older version issues and check if the problem persists.


-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Fail to add Preferred Communication Method
May 28, 2008, 12:55:59 am
v2 needs PHP 5.2 which is not available on this server.

Carlo

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Fail to add Preferred Communication Method
May 28, 2008, 08:30:43 am
Do the Preferred Communication Method choices appear when editing a contact record?

You can verify the current state of the database stored choices via MySQL command line or phpMyAdmin...

First verify the id of the Preferred Communication Method option group:
Code: [Select]
SELECT id FROM `civicrm_option_group` where name = 'preferred_communication_method';

Then select the currently available option values in that option group. In my 1.9 install, the query above returns an id of 1 - so...

Code: [Select]
SELECT * FROM `civicrm_option_value`
WHERE option_group_id =1;

Gives me a list of the values in my install.

If this all looks ok - you could potentially insert your new value using MySQL. However, I would recommend running the procedure for "Ensuring Schema Integrity" described in the second section of this page - as it's possible there are other schema issues in your upgraded site:
http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades

Protect your investment in CiviCRM by  becoming a Member!

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Fail to add Preferred Communication Method
May 29, 2008, 01:42:56 am
I think I have done that step before, but i will try it again.
I will report back here because I have more issues now its seems.

Thx,

Carlo

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Fail to add Preferred Communication Method
May 29, 2008, 02:08:49 am
When i edit a contact I cannot select the "Method"

This is the first sql:

Code: [Select]
mysql> SELECT id FROM `civicrm_option_group` where name = 'preferred_communication_method';
Empty set (0.00 sec)

Second one (I've used your ID because my query didn't return one):

Code: [Select]
mysql> SELECT * FROM `civicrm_option_value`
    -> WHERE option_group_id =1;
+----+-----------------+------------+-------+------------+----------+--------+------------+--------+-----------------------+-------------+-------------+-----------+
| id | option_group_id | label      | value | name       | grouping | filter | is_default | weight | description           | is_optgroup | is_reserved | is_active |
+----+-----------------+------------+-------+------------+----------+--------+------------+--------+-----------------------+-------------+-------------+-----------+
|  1 |               1 | Meeting    |     1 | Meeting    | NULL     |      0 |       NULL |      1 | Schedule a meeting    |           0 |           0 |         1 |
|  2 |               1 | Phone Call |     2 | Phone Call | NULL     |      0 |       NULL |      2 | Schedule a Phone Call |           0 |           0 |         1 |
|  3 |               1 | Email      |     3 | Email      | NULL     |      0 |       NULL |      3 | Email Sent            |           0 |           0 |         1 |
|  4 |               1 | SMS        |     4 | SMS        | NULL     |      0 |       NULL |      4 | SMS                   |           0 |           0 |         1 |
|  5 |               1 | Event      |     5 | Event      | NULL     |      0 |       NULL |      5 | Event                 |           0 |           0 |         1 |
+----+-----------------+------------+-------+------------+----------+--------+------------+--------+-----------------------+-------------+-------------+-----------+
5 rows in set (0.01 sec)

I've been using this install since a long time (probably from v1.3) and many updates have gone over it. Maybe this is the problem with the missing preferred_communication_method in civicrm_option_group?

Thx,

Carlo

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Fail to add Preferred Communication Method
May 29, 2008, 04:11:28 am
Quote
Maybe this is the problem with the missing preferred_communication_method in civicrm_option_group?

Right, so you could try adding the missing option group and its values.

Following query should help you do that -
Code: [Select]
set @domain_id = 1;

INSERT INTO
   `civicrm_option_group` (`domain_id`, `name`, `description`, `is_reserved`, `is_active`)
VALUES
   (@domain_id, 'preferred_communication_method', 'Preferred Communication Method'     , 0, 1);

SELECT @option_group_id_pcm  := max(id) from civicrm_option_group where name = 'preferred_communication_method';

INSERT INTO
   `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`)
VALUES
   (@option_group_id_pcm, 'Phone', 1, NULL, NULL, 0, NULL, 1, NULL, 0, 0, 1, NULL),
   (@option_group_id_pcm, 'Email', 2, NULL, NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL),
   (@option_group_id_pcm, 'Postal Mail', 3, NULL, NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL),
   (@option_group_id_pcm, 'SMS', 4, NULL, NULL, 0, NULL, 4, NULL, 0, 0, 1, NULL),
   (@option_group_id_pcm, 'Fax', 5, NULL, NULL, 0, NULL, 5, NULL, 0, 0, 1, NULL);


Note: Entire query should be run as a single query
« Last Edit: May 29, 2008, 04:13:18 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Fail to add Preferred Communication Method
June 10, 2008, 05:00:02 am
Thank you for your feedback. This seems to have fixed our problems. Now that we are upgrading we are seeing more problems. It looks like after upgrading more then 5 times our database schema doesn't seem correct anymore. We are now looking for a solution. If somebody has suggestion please let me know.

Br,

Carlo

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Fail to add Preferred Communication Method
June 10, 2008, 06:08:38 am
might be an idea to rebuild your database to ensure schema integrity. There are details here:

http://forum.civicrm.org/index.php/topic,2473.msg10529.html#msg10529

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Fail to add Preferred Communication Method

This forum was archived on 2017-11-26.