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 (Moderator: Dave Greenberg) »
  • A non-recoverable error: Could not find valid value for ct
Pages: [1] 2

Author Topic: A non-recoverable error: Could not find valid value for ct  (Read 30571 times)

sdybiec

  • Guest
A non-recoverable error: Could not find valid value for ct
August 31, 2007, 07:37:06 am
I have run into a frustrating problem. Been trying to debug it myself for a couple days w/o any luck.

I successfully installed CiviCRM 1.8 on Drupal 5.1 and began to customize it. Then I started to get 'Could not find valid value for ct' non-recoverable errors for any attempt to add or update a contact. I can't trace it to any particular thing I did. All my actions have been through the CiviCRM or Drupal interfaces.

I found other posters that had this same problem show up as well:

http://www.nabble.com/Unrecoverable-Error-tf2213363s15986.html#a7928181

I've tried to trace down the bug/issue with watchdog log lines inserted in strategic places w/o any luck. Below is a backtrace after the problem occurs ---- when I attempt to add or update an Individual. Some of the line numbers might have changed by one or two lines from the original 1.8 code due to my watchdog logging lines.

The 'ct' request variable is somehow tied up in the request and the session, but gets lost in the multiple calls to the service a single add or update.

backTrace

/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 251
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Utils/Request.php, fatal, 108
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Contact/Form/Edit.php, retrieve, 152
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Core/Form.php, preProcess, 283
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php, buildForm, 98
/home/uaprogre/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 195
/home/uaprogre/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 95
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 213
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php, run, 77
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 492
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php, form, 191
/home/uaprogre/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php, contact, 92
/home/uaprogre/public_html/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 331
, civicrm_invoke,
/home/uaprogre/public_html/includes/menu.inc, call_user_func_array, 418
/home/uaprogre/public_html/index.php, menu_execute_active_handler, 15

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    Could not find valid value for ct

    Return to home page.


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: A non-recoverable error: Could not find valid value for ct
August 31, 2007, 12:54:19 pm

1. what version of mysql are you using

2. what customizations did you do? are you doing any code customizations?

3. Are you using utf8 characters in your add/edit contact entry

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

sdybiec

  • Guest
Re: A non-recoverable error: Could not find valid value for ct
August 31, 2007, 07:22:12 pm

My hosting provider is bluehost.com

1. MySQL version 5.0.27
2. No code customizations. Only creating some new custom fields.
3. No UTF characters in my forms. If I edit an existing contact from the sample ones included with the initial installation, it fails when I hit the "Save" button. If I try to create a new Individual with only a name and email address, it fails on "Save".

Hope this helps.




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: A non-recoverable error: Could not find valid value for ct
August 31, 2007, 11:11:37 pm

I'm lost here, but a few more random questions:

1. Are you running as drupal admin or anonymous user or some logged in user with admin privileges

2. Do you have drupal caching enabled

3. Can you check if your host is running any php accelerator software. If so, can you disable it and see if the problem disappears

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

sdybiec

  • Guest
Re: A non-recoverable error: Could not find valid value for ct
September 01, 2007, 05:18:41 am
1. Running drupal as admin.
2. Have tried it with and without caching.
3. Here's my php configuration. I think that version of the Zend Optimizer is supported by CiviCRM, or is it? What about the register_globals parameter below?

  Sub Section     Directive     Info     Value
asp_tags    Allow ASP-style <% %> tags.    Off
file_uploads    Whether to allow HTTP file uploads.    On
max_execution_time    Maximum execution time of each script, in seconds    30
max_input_time    Maximum amount of time each script may spend parsing request data    60
memory_limit    Maximum amount of memory a script may consume (10MB)    10M
register_globals    You should do your best to write your scripts so that they do not require register_globals to be on; Using form variables as globals can easily lead to possible security problems, if the code is not very well thought of.    Off
safe_mode       Off
session.save_path       N;/path
upload_max_filesize    Maximum allowed size for uploaded files.    2M
zend_optimizer.version       3.2.8

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: A non-recoverable error: Could not find valid value for ct
September 01, 2007, 12:14:39 pm

1. The register globals is fine
2. can u try t disable the zend optimizer and see if it work

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

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: A non-recoverable error: Could not find valid value for ct
September 02, 2007, 04:10:04 pm
I saw these type errors while connecting a new CiviCRM database to an existing Drupal site which had a corrupted CiviCRM.

They disappeared when I synchronised the Drupal users with CiviCRM contacts in Adminster CiviCRM.

The new database had no entries in civicrm_uf_match (except user 1, cid=1) and seemed to be much happier once it was populated.

Neil

sdybiec

  • Guest
Re: A non-recoverable error: Could not find valid value for ct
September 11, 2007, 04:29:10 pm
Thanks for your responses. I've tried both of them w/o luck. Turned off Zend optimization and resynchronized the users.

I've continued trying to figure out where things are going wrong by tracing through the code. Now I need some help from those that understand how the CiviCRM code is supposed to work.

My use case is to click on 'Add Individual', fill in a first and last name, then hit the 'Check for Matching Contacts' button or the 'Save' button --- both result in the backtrace I posted earlier.

I've instrumented civicrm/CRM/Core/Invoke::contact()  with watchdog lines that tell me when the 'ct' request variable is found and when not. I've also turned on the devel modules ability to print SQL requests.

Here's what I found. For some reason thie Invoke::contact() function is being called multiple times for a single submit. On the first call everything is ok --- the 'ct' variable is found in the $_REQUEST as expected. Here's the value of $_REQUEST:

_REQUEST = Array ( [q] => civicrm/contact/add [qfKey] => 6ef2676c96ffd6550d87cc90d5f16c99_6120 [ct] => Individual [_qf_default] => Edit:next [prefix_id] => [first_name] => d [middle_name] => [last_name] => sdfd [suffix_id] => [nick_name] => [greeting_type] => Formal [contact_source] => [job_title] => [current_employer] => [home_URL] => [external_identifier] => [_qf_Edit_refresh_dedupe] => Check for Matching Contact(s) [privacy] => Array ( [do_not_phone] => [do_not_email] => [do_not_mail] => [do_not_trade] => ) [preferred_communication_method] => Array ( [1] => [2] => [3] => ) [preferred_mail_format] => Both [custom_8] => X [custom_9] => Array ( [M] => [d] => [Y] => ) [custom_10] => [custom_15] => Array (
  • => NONE ) [location] => Array ( [1] => Array ( [location_type_id] => 1 [is_primary] => 1 [name] => [phone] => Array ( [1] => Array ( [phone_type] => [phone] => ) [2] => Array ( [phone_type] => [phone] => ) [3] => Array ( [phone_type] => [phone] => ) ) [email] => Array ( [1] => Array ( [email] => [on_hold] => ) [2] => Array ( [email] => [on_hold] => ) [3] => Array ( [email] => [on_hold] => ) ) [im] => Array ( [1] => Array ( [provider_id] => [name] => ) [2] => Array ( [provider_id] => [name] => ) [3] => Array ( [provider_id] => [name] => ) ) [address] => Array ( [street_address] => [supplemental_address_1] => [supplemental_address_2] => [city] => [postal_code] => [postal_code_suffix] => [country_id] => 1228 [state_province_id] => [geo_code_1] => [geo_code_2] => ) ) ) [shared_option] => 0 [shared_household] => [shared_household_selected] => [create_household] => [birth_date] => Array ( [M] => [d] => [Y] => ) [deceased_date] => Array ( [M] => [d] => [Y] => ) [note] => [PHPSESSID] => 294b7d89ae3aeca8ee8c7430df66be67 )


Then a second call is made to this same function during this same submission, except this time the 'ct' variable is not found in the $_REQUEST. After the second call, here's the value of $_REQUEST:

_REQUEST = Array ( [q] => civicrm/contact/add [PHPSESSID] => 294b7d89ae3aeca8ee8c7430df66be67 )

Why is this 'Invoke::contact' function being called twice for a single form submission? If it should be being called twice, how is the request supposed to be preserved between requests? Why did the value of $_REQUEST change for a single submit?


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: A non-recoverable error: Could not find valid value for ct
September 11, 2007, 05:11:42 pm

We use the PRG pattern and hence u see two calls to Invoke::contact( ). You can learn more about this pattern at: http://en.wikipedia.org/wiki/Post/Redirect/Get

The REQUEST vars are stored in the session after the first request and then retrieved from the session in the second request. Your session is getting destroyed between the two requests. thats the root cause of the problem. not sure why this is happening. You might want to monitor writes to the session table in drupal and see why etc.


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

sdybiec

  • Guest
Re: A non-recoverable error: Could not find valid value for ct
September 11, 2007, 06:56:27 pm
Thanks. That was quite helpful.

I did monitor the SQL statement using the devel module. It appeared to me that the session table writes were taking place properly, but I don't really know what to expect:

SELECT sid FROM sessions WHERE sid = '294b7d89ae3aeca8ee8c7430df66be67'

UPDATE sessions SET uid = 1, cache = 0, hostname = '24.160.188.149', session = 'CiviCRM|a:14:{s:8:\"domainID\";i:1;s:4:\"ufID\";s:1:\"1\";s:6:\"userID\";s:3:\"102\";s:7:\"ufEmail\";s:21:\"scott@humanfactor.com\";s:31:\"CRM_Contact_Page_View_DashBoard\";a:13:{s:6:\"action\";i:4;s:11:\"displayName\";s:12:\"Scott Dybiec\";s:12:\"contactImage\";s:105:\"<img src=\"http://uaprogressiveaction.com/sites/all/modules/civicrm/i/contact_ind.gif\" alt=\"Individual\" />\";s:13:\"columnHeaders\";a:7:{i:0;a:3:{s:4:\"name\";s:8:\"Activity\";s:4:\"sort\";s:13:\"activity_type\";s:9:\"direction\";i:4;}i:1;a:1:{s:4:\"name\";s:7:\"Subject\";}i:2;a:1:{s:4:\"name\";s:10:\"Created By\";}i:3;a:1:{s:4:\"name\";s:12:\"With Contact\";}i:4;a:3:{s:4:\"name\";s:9:\"Scheduled\";s:4:\"sort\";s:4:\"date\";s:9:\"direction\";i:1;}i:5;a:1:{s:4:\"name\";s:6:\"Status\";}i:6;a:1:{s:4:\"desc\";s:7:\"Actions\";}}s:4:\"rows\";a:0:{}s:8:\"rowCount\";i:0;s:9:\"rowsEmpty\";b:1;s:4:\"qill\";N;s:6:\"crmPID\";d:0;s:6:\"crmSID\";i:1;s:16:\"crmSortDirection\";i:1;s:12:\"crmSortOrder\";s:8:\"date asc\";s:11:\"crmRowCount\";i:50;}s:16:\"CRM_Utils_Recent\";a:1:{i:0;a:4:{s:5:\"title\";s:12:\"Scott Dybiec\";s:3:\"url\";s:71:\"http://uaprogressiveaction.com/civicrm/contact/view?reset=1&amp;cid=102\";s:4:\"icon\";s:105:\"<img src=\"http://uaprogressiveaction.com/sites/all/modules/civicrm/i/contact_ind.gif\" alt=\"Individual\" />\";s:2:\"id\";s:3:\"102\";}}s:12:\"qfPrivateKey\";s:64:\"6a00dcf6eda9f34f8b2d7e8fbf62f8ed9b80c8ac12bd2abcfb4454a8648b2d1c\";s:11:\"qfSessionID\";s:32:\"294b7d89ae3aeca8ee8c7430df66be67\";s:59:\"CRM_Contact_Form_Edit_6ef2676c96ffd6550d87cc90d5f16c99_6120\";a:3:{s:5:\"qfKey\";s:37:\"6ef2676c96ffd6550d87cc90d5f16c99_6120\";s:6:\"action\";i:1;s:2:\"ct\";s:10:\"Individual\";}s:11:\"uploadNames\";a:0:{}s:13:\"numberDomains\";s:1:\"1\";s:59:\"CRM_Contact_Form_Edit_6ef2676c96ffd6550d87cc90d5f16c99_6184\";a:2:{s:5:\"qfKey\";s:37:\"6ef2676c96ffd6550d87cc90d5f16c99_6184\";s:6:\"action\";i:1;}s:57:\"CRM_Contact_Form_Edit_6ef2676c96ffd6550d87cc90d5f16c99_42\";a:3:{s:5:\"qfKey\";s:35:\"6ef2676c96ffd6550d87cc90d5f16c99_42\";s:6:\"action\";i:1;s:2:\"ct\";s:10:\"Individual\";}s:59:\"CRM_Contact_Form_Edit_6ef2676c96ffd6550d87cc90d5f16c99_6486\";a:2:{s:5:\"qfKey\";s:37:\"6ef2676c96ffd6550d87cc90d5f16c99_6486\";s:6:\"action\";i:1;}}_CRM_Core_Controller_Simple_6ef2676c96ffd6550d87cc90d5f16c99_6120_container|a:5:{s:8:\"defaults\";a:0:{}s:9:\"constants\";a:0:{}s:6:\"values\";a:1:{s:4:\"Edit\";a:31:{s:5:\"qfKey\";s:37:\"6ef2676c96ffd6550d87cc90d5f16c99_6120\";s:9:\"prefix_id\";s:0:\"\";s:10:\"first_name\";s:1:\"d\";s:11:\"middle_name\";s:0:\"\";s:9:\"last_name\";s:4:\"sdfd\";s:9:\"suffix_id\";s:0:\"\";s:9:\"nick_name\";s:0:\"\";s:13:\"greeting_type\";s:6:\"Formal\";s:9:\"job_title\";s:0:\"\";s:13:\"deceased_date\";a:3:{s:1:\"M\";s:0:\"\";s:1:\"d\";s:0:\"\";s:1:\"Y\";s:0:\"\";}s:10:\"birth_date\";a:3:{s:1:\"M\";s:0:\"\";s:1:\"d\";s:0:\"\";s:1:\"Y\";s:0:\"\";}s:13:\"shared_option\";s:1:\"0\";s:16:\"create_household\";s:0:\"\";s:16:\"shared_household\";s:0:\"\";s:8:\"home_URL\";s:0:\"\";s:16:\"current_employer\";s:0:\"\";s:14:\"contact_source\";s:0:\"\";s:2:\"ct\";s:10:\"Individual\";s:19:\"external_identifier\";s:0:\"\";s:7:\"privacy\";a:4:{s:12:\"do_not_phone\";s:0:\"\";s:12:\"do_not_email\";s:0:\"\";s:11:\"do_not_mail\";s:0:\"\";s:12:\"do_not_trade\";s:0:\"\";}s:30:\"preferred_communication_method\";a:3:{i:1;s:0:\"\";i:2;s:0:\"\";i:3;s:0:\"\";}s:21:\"preferred_mail_format\";s:4:\"Both\";s:8:\"location\";a:1:{i:1;a:7:{s:16:\"location_type_id\";s:1:\"1\";s:10:\"is_primary\";s:1:\"1\";s:4:\"name\";s:0:\"\";s:7:\"address\";a:10:{s:14:\"street_address\";s:0:\"\";s:22:\"supplemental_address_1\";s:0:\"\";s:22:\"supplemental_address_2\";s:0:\"\";s:4:\"city\";s:0:\"\";s:11:\"postal_code\";s:0:\"\";s:18:\"postal_code_suffix\";s:0:\"\";s:17:\"state_province_id\";s:0:\"\";s:10:\"country_id\";s:4:\"1228\";s:10:\"geo_code_1\";s:0:\"\";s:10:\"geo_code_2\";s:0:\"\";}s:5:\"phone\";a:3:{i:1;a:2:{s:10:\"phone_type\";s:0:\"\";s:5:\"phone\";s:0:\"\";}i:2;a:2:{s:10:\"phone_type\";s:0:\"\";s:5:\"phone\";s:0:\"\";}i:3;a:2:{s:10:\"phone_type\";s:0:\"\";s:5:\"phone\";s:0:\"\";}}s:5:\"email\";a:3:{i:1;a:2:{s:5:\"email\";s:0:\"\";s:7:\"on_hold\";s:0:\"\";}i:2;a:2:{s:5:\"email\";s:0:\"\";s:7:\"on_hold\";s:0:\"\";}i:3;a:2:{s:5:\"email\";s:0:\"\";s:7:\"on_hold\";s:0:\"\";}}s:2:\"im\";a:3:{i:1;a:2:{s:11:\"provider_id\";s:0:\"\";s:4:\"name\";s:0:\"\";}i:2;a:2:{s:11:\"provider_id\";s:0:\"\";s:4:\"name\";s:0:\"\";}i:3;a:2:{s:11:\"provider_id\";s:0:\"\";s:4:\"name\";s:0:\"\";}}}}s:4:\"note\";s:0:\"\";s:8:\"custom_8\";s:1:\"X\";s:8:\"custom_9\";a:3:{s:1:\"M\";s:0:\"\";s:1:\"d\";s:0:\"\";s:1:\"Y\";s:0:\"\";}s:9:\"custom_10\";s:0:\"\";s:9:\"custom_11\";a:0:{}s:9:\"custom_15\";a:1:{i:0;s:4:\"NONE\";}s:23:\"_qf_Edit_refresh_dedupe\";s:29:\"Check for Matching Contact(s)\";s:11:\"_qf_default\";s:9:\"Edit:next\";}}s:5:\"valid\";a:1:{s:4:\"Edit\";b:0;}s:15:\"_qf_button_name\";s:23:\"_qf_Edit_refresh_dedupe\";}watchdog_overview_filter|s:3:\"all\";_CRM_Core_Controller_Simple_6ef2676c96ffd6550d87cc90d5f16c99_6184_container|a:4:{s:8:\"defaults\";a:0:{}s:9:\"constants\";a:0:{}s:6:\"values\";a:1:{s:4:\"Edit\";a:0:{}}s:5:\"valid\";a:1:{s:4:\"Edit\";N;}}_CRM_Core_Controller_Simple_6ef2676c96ffd6550d87cc90d5f16c99_42_container|a:5:{s:8:\"defaults\";a:0:{}s:9:\"constants\";a:0:{}s:6:\"values\";a:1:{s:4:\"Edit\";a:31:{s:5:\"qfKey\";s:35:\"6ef2676c96ffd6550d87cc90d5f16c99_42\";s:9:\"prefix_id\";s:0:\"\";s:10:\"first_name\";s:5:\"scott\";s:11:\"middle_name\";s:0:\"\";s:9:\"last_name\";s:4:\"Data\";s:9:\"suffix_id\";s:0:\"\";s:9:\"nick_name\";s:0:\"\";s:13:\"greeting_type\";s:6:\"Formal\";s:9:\"job_title\";s:0:\"\";s:13:\"deceased_date\";a:3:{s:1:\"M\";s:0:\"\";s:1:\"d\";s:0:\"\";s:1:\"Y\";s:0:\"\";}s:10:\"birth_date\";a:3:{s:1:\"M\";s:0:\"\";s:1:\"d\";s:0:\"\";s:1:\"Y\";s:0:\"\";}s:13:\"shared_option\";s:1:\"0\";s:16:\"create_household\";s:0:\"\";s:16:\"shared_household\";s:0:\"\";s:8:\"home_URL\";s:0:\"\";s:16:\"current_employer\";s:0:\"\";s:14:\"contact_source\";s:0:\"\";s:2:\"ct\";s:10:\"Individual\";s:19:\"external_identifier\";s:0:\"\";s:7:\"privacy\";a:4:{s:12:\"do_not_phone\";s:0:\"\";s:12:\"do_not_email\";s:0:\"\";s:11:\"do_not_mail\";s:0:\"\";s:12:\"do_not_trade\";s:0:\"\";}s:30:\"preferred_communication_method\";a:3:{i:1;s:0:\"\";i:2;s:0:\"\";i:3;s:0:\"\";}s:21:\"preferred_mail_format\";s:4:\"Both\";s:8:\"location\";a:1:{i:1;a:7:{s:16:\"location_type_id\";s:1:\"1\";s:10:\"is_primary\";s:1:\"1\";s:4:\"name\";s:0:\"\";s:7:\"address\";a:10:{s:14:\"street_address\";s:0:\"\";s:22:\"supplemental_address_1\";s:0:\"\";s:22:\"supplemental_address_2\";s:0:\"\";s:4:\"city\";s:0:\"\";s:11:\"postal_code\";s:0:\"\";s:18:\"postal_code_suffix\";s:0:\"\";s:17:\"state_province_id\";s:0:\"\";s:10:\"country_id\";s:4:\"1228\";s:10:\"geo_code_1\";s:0:\"\";s:10:\"geo_code_2\";s:0:\"\";}s:5:\"phone\";a:3:{i:1;a:2:{s:10:\"phone_type\";s:0:\"\";s:5:\"phone\";s:0:\"\";}i:2;a:2:{s:10:\"phone_type\";s:0:\"\";s:5:\"phone\";s:0:\"\";}i:3;a:2:{s:10:\"phone_type\";s:0:\"\";s:5:\"phone\";s:0:\"\";}}s:5:\"email\";a:3:{i:1;a:2:{s:5:\"email\";s:0:\"\";s:7:\"on_hold\";s:0:\"\";}i:2;a:2:{s:5:\"email\";s:0:\"\";s:7:\"on_hold\";s:0:\"\";}i:3;a:2:{s:5:\"email\";s:0:\"\";s:7:\"on_hold\";s:0:\"\";}}s:2:\"im\";a:3:{i:1;a:2:{s:11:\"provider_id\";s:0:\"\";s:4:\"name\";s:0:\"\";}i:2;a:2:{s:11:\"provider_id\";s:0:\"\";s:4:\"name\";s:0:\"\";}i:3;a:2:{s:11:\"provider_id\";s:0:\"\";s:4:\"name\";s:0:\"\";}}}}s:4:\"note\";s:0:\"\";s:8:\"custom_8\";s:1:\"X\";s:8:\"custom_9\";a:3:{s:1:\"M\";s:0:\"\";s:1:\"d\";s:0:\"\";s:1:\"Y\";s:0:\"\";}s:9:\"custom_10\";s:0:\"\";s:9:\"custom_11\";a:0:{}s:9:\"custom_15\";a:1:{i:0;s:4:\"NONE\";}s:23:\"_qf_Edit_refresh_dedupe\";s:29:\"Check for Matching Contact(s)\";s:11:\"_qf_default\";s:9:\"Edit:next\";}}s:5:\"valid\";a:1:{s:4:\"Edit\";b:0;}s:15:\"_qf_button_name\";s:23:\"_qf_Edit_refresh_dedupe\";}messages|a:1:{s:6:\"status\";a:1:{i:0;s:38:\"You have been successfully subscribed.\";}}_CRM_Core_Controller_Simple_6ef2676c96ffd6550d87cc90d5f16c99_6486_container|a:4:{s:8:\"defaults\";a:0:{}s:9:\"constants\";a:0:{}s:6:\"values\";a:1:{s:4:\"Edit\";a:0:{}}s:5:\"valid\";a:1:{s:4:\"Edit\";N;}}', timestamp = 1189561663 WHERE sid = '294b7d89ae3aeca8ee8c7430df66be67'

UPDATE users SET access = 1189561663 WHERE uid = 1

Does this look normal? I see some duplication in the session content.

Can you give some recommendations as to which CiviCRM PHP programs should I do more tracing in to figure out what's happening with the session during the request?

One other question. This is the line of code from Invoke::contact() that is trying to get the 'ct' variable and failing. How would this code end up pulling the value from the session?

$contactType    = CRM_Utils_Request::retrieve('ct','String', CRM_Core_DAO::$_nullObject,false,null,'REQUEST');


$cott

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: A non-recoverable error: Could not find valid value for ct
September 11, 2007, 07:36:04 pm

There should be two updates to the session in your db / devel log (one for the POST request and another for the GET request). kinda hard to tell which one the below is, but it does seem to have the right "ct" value

The line that is failing is in: Edit.php, line 152. The object knows how to set/get variables from the session (using singleton)

might be easier to debug this on IRC

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

sdybiec

  • Guest
Re: A non-recoverable error: Could not find valid value for ct
September 14, 2007, 03:17:28 pm
OK, I instrumented civicrm/CRM/Contact/Form/Edit.php at line 152 with watchdog lines and found that the ct value is set properly to 'Individual'.

if ( $this->_action == CRM_Core_Action::ADD ) {
            $this->_contactType = CRM_Utils_Request::retrieve( 'ct', 'String',
                                                               $this, true, null, 'REQUEST' );
/// my watchdog code
...
}

This code is only being called once in the submit process. Is that the way it should be?

I used MySQLAdmin to query for the particular session used for this attempted add operation. Seems the session is growing. Lots of instances of "ct" all with the value 'Individual'.

I always restart my use case by selecting "Add Individual", because I see that the URL link has a "reset=1" parameter. I figure that should be resetting things.

CiviCRM|a:21:{s:8:"domainID";i:1;s:4:"ufID";s:1:"1";s:6:"userID";s:3:"102";s:7:"ufEmail";s:21:"scott@humanfactor.com";s:16:"CRM_Utils_Recent";a:1:{i:0;a:4:{s:5:"title";s:12:"Scott Dybiec";s:3:"url";s:71:"http://uaprogressiveaction.com/civicrm/contact/view?reset=1&amp;cid=102";s:4:"icon";s:105:"<img src="http://uaprogressiveaction.com/sites/all/modules/civicrm/i/contact_ind.gif" alt="Individual" />";s:2:"id";s:3:"102";}}s:12:"qfPrivateKey";s:64:"c2f87e21122ac9b1820b2f05cd6674d4ee26b4c0abb5a6cc64eb88dba2a0f411";s:11:"qfSessionID";s:32:"23cc65af07776ca042ec60fa2f23a0f3";s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_6217";a:3:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_6217";s:6:"action";i:1;s:2:"ct";s:10:"Individual";}s:11:"uploadNames";a:0:{}s:13:"numberDomains";s:1:"1";s:58:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_482";a:2:{s:5:"qfKey";s:36:"212654f6fe741db2cf66b7de389bae46_482";s:6:"action";i:1;}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_1077";a:3:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_1077";s:6:"action";i:1;s:2:"ct";s:10:"Individual";}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_1469";a:3:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_1469";s:6:"action";i:1;s:2:"ct";s:10:"Individual";}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_9229";a:2:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_9229";s:6:"action";i:1;}s:58:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_286";a:3:{s:5:"qfKey";s:36:"212654f6fe741db2cf66b7de389bae46_286";s:6:"action";i:1;s:2:"ct";s:10:"Individual";}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_5740";a:3:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_5740";s:6:"action";i:1;s:2:"ct";s:10:"Individual";}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_1914";a:2:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_1914";s:6:"action";i:1;}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_5390";a:3:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_5390";s:6:"action";i:1;s:2:"ct";s:10:"Individual";}s:31:"CRM_Contact_Page_View_DashBoard";a:13:{s:6:"action";i:4;s:11:"displayName";s:12:"Scott Dybiec";s:12:"contactImage";s:105:"<img src="http://uaprogressiveaction.com/sites/all/modules/civicrm/i/contact_ind.gif" alt="Individual" />";s:13:"columnHeaders";a:7:{i:0;a:3:{s:4:"name";s:8:"Activity";s:4:"sort";s:13:"activity_type";s:9:"direction";i:4;}i:1;a:1:{s:4:"name";s:7:"Subject";}i:2;a:1:{s:4:"name";s:10:"Created By";}i:3;a:1:{s:4:"name";s:12:"With Contact";}i:4;a:3:{s:4:"name";s:9:"Scheduled";s:4:"sort";s:4:"date";s:9:"direction";i:1;}i:5;a:1:{s:4:"name";s:6:"Status";}i:6;a:1:{s:4:"desc";s:7:"Actions";}}s:4:"rows";a:0:{}s:8:"rowCount";i:0;s:9:"rowsEmpty";b:1;s:4:"qill";N;s:6:"crmPID";d:0;s:6:"crmSID";i:1;s:16:"crmSortDirection";i:1;s:12:"crmSortOrder";s:8:"date asc";s:11:"crmRowCount";i:50;}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_8311";a:3:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_8311";s:6:"action";i:1;s:2:"ct";s:10:"Individual";}s:59:"CRM_Contact_Form_Edit_212654f6fe741db2cf66b7de389bae46_1637";a:2:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_1637";s:6:"action";i:1;}}watchdog_overview_filter|s:3:"all";_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_6217_container|a:5:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:31:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_6217";s:9:"prefix_id";s:0:"";s:10:"first_name";s:3:"sdd";s:11:"middle_name";s:1:"e";s:9:"last_name";s:5:"gates";s:9:"suffix_id";s:0:"";s:9:"nick_name";s:0:"";s:13:"greeting_type";s:6:"Formal";s:9:"job_title";s:0:"";s:13:"deceased_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:10:"birth_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:13:"shared_option";s:1:"0";s:16:"create_household";s:0:"";s:16:"shared_household";s:0:"";s:8:"home_URL";s:0:"";s:16:"current_employer";s:0:"";s:14:"contact_source";s:0:"";s:2:"ct";s:10:"Individual";s:19:"external_identifier";s:0:"";s:7:"privacy";a:4:{s:12:"do_not_phone";s:0:"";s:12:"do_not_email";s:0:"";s:11:"do_not_mail";s:0:"";s:12:"do_not_trade";s:0:"";}s:30:"preferred_communication_method";a:3:{i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";}s:21:"preferred_mail_format";s:4:"Both";s:8:"location";a:1:{i:1;a:7:{s:16:"location_type_id";s:1:"1";s:10:"is_primary";s:1:"1";s:4:"name";s:0:"";s:7:"address";a:10:{s:14:"street_address";s:0:"";s:22:"supplemental_address_1";s:0:"";s:22:"supplemental_address_2";s:0:"";s:4:"city";s:0:"";s:11:"postal_code";s:0:"";s:18:"postal_code_suffix";s:0:"";s:17:"state_province_id";s:0:"";s:10:"country_id";s:4:"1228";s:10:"geo_code_1";s:0:"";s:10:"geo_code_2";s:0:"";}s:5:"phone";a:3:{i:1;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:2;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:3;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}}s:5:"email";a:3:{i:1;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:2;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:3;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}}s:2:"im";a:3:{i:1;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:2;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:3;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}}}}s:4:"note";s:0:"";s:8:"custom_8";s:1:"X";s:8:"custom_9";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:9:"custom_10";s:0:"";s:9:"custom_11";a:0:{}s:9:"custom_15";a:1:{i:0;s:4:"NONE";}s:23:"_qf_Edit_refresh_dedupe";s:29:"Check for Matching Contact(s)";s:11:"_qf_default";s:9:"Edit:next";}}s:5:"valid";a:1:{s:4:"Edit";b:0;}s:15:"_qf_button_name";s:23:"_qf_Edit_refresh_dedupe";}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_482_container|a:4:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:0:{}}s:5:"valid";a:1:{s:4:"Edit";N;}}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_1077_container|a:4:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:0:{}}s:5:"valid";a:1:{s:4:"Edit";N;}}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_1469_container|a:5:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:31:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_1469";s:9:"prefix_id";s:0:"";s:10:"first_name";s:3:"sdd";s:11:"middle_name";s:1:"t";s:9:"last_name";s:4:"fdst";s:9:"suffix_id";s:0:"";s:9:"nick_name";s:0:"";s:13:"greeting_type";s:6:"Formal";s:9:"job_title";s:0:"";s:13:"deceased_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:10:"birth_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:13:"shared_option";s:1:"0";s:16:"create_household";s:0:"";s:16:"shared_household";s:0:"";s:8:"home_URL";s:0:"";s:16:"current_employer";s:0:"";s:14:"contact_source";s:0:"";s:2:"ct";s:10:"Individual";s:19:"external_identifier";s:0:"";s:7:"privacy";a:4:{s:12:"do_not_phone";s:0:"";s:12:"do_not_email";s:0:"";s:11:"do_not_mail";s:0:"";s:12:"do_not_trade";s:0:"";}s:30:"preferred_communication_method";a:3:{i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";}s:21:"preferred_mail_format";s:4:"Both";s:8:"location";a:1:{i:1;a:7:{s:16:"location_type_id";s:1:"1";s:10:"is_primary";s:1:"1";s:4:"name";s:0:"";s:7:"address";a:10:{s:14:"street_address";s:0:"";s:22:"supplemental_address_1";s:0:"";s:22:"supplemental_address_2";s:0:"";s:4:"city";s:0:"";s:11:"postal_code";s:0:"";s:18:"postal_code_suffix";s:0:"";s:17:"state_province_id";s:0:"";s:10:"country_id";s:4:"1228";s:10:"geo_code_1";s:0:"";s:10:"geo_code_2";s:0:"";}s:5:"phone";a:3:{i:1;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:2;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:3;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}}s:5:"email";a:3:{i:1;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:2;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:3;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}}s:2:"im";a:3:{i:1;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:2;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:3;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}}}}s:4:"note";s:0:"";s:8:"custom_8";s:1:"X";s:8:"custom_9";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:9:"custom_10";s:0:"";s:9:"custom_11";a:0:{}s:9:"custom_15";a:1:{i:0;s:4:"NONE";}s:11:"_qf_default";s:9:"Edit:next";s:18:"_qf_Edit_next_view";s:4:"Save";}}s:5:"valid";a:1:{s:4:"Edit";b:0;}s:15:"_qf_button_name";s:18:"_qf_Edit_next_view";}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_9229_container|a:4:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:0:{}}s:5:"valid";a:1:{s:4:"Edit";N;}}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_286_container|a:4:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:0:{}}s:5:"valid";a:1:{s:4:"Edit";N;}}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_5740_container|a:5:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:31:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_5740";s:9:"prefix_id";s:1:"2";s:10:"first_name";s:2:"df";s:11:"middle_name";s:1:"e";s:9:"last_name";s:8:"datatype";s:9:"suffix_id";s:0:"";s:9:"nick_name";s:0:"";s:13:"greeting_type";s:6:"Formal";s:9:"job_title";s:0:"";s:13:"deceased_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:10:"birth_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:13:"shared_option";s:1:"0";s:16:"create_household";s:0:"";s:16:"shared_household";s:0:"";s:8:"home_URL";s:0:"";s:16:"current_employer";s:0:"";s:14:"contact_source";s:0:"";s:2:"ct";s:10:"Individual";s:19:"external_identifier";s:0:"";s:7:"privacy";a:4:{s:12:"do_not_phone";s:0:"";s:12:"do_not_email";s:0:"";s:11:"do_not_mail";s:0:"";s:12:"do_not_trade";s:0:"";}s:30:"preferred_communication_method";a:3:{i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";}s:21:"preferred_mail_format";s:4:"Both";s:8:"location";a:1:{i:1;a:7:{s:16:"location_type_id";s:1:"1";s:10:"is_primary";s:1:"1";s:4:"name";s:0:"";s:7:"address";a:10:{s:14:"street_address";s:0:"";s:22:"supplemental_address_1";s:0:"";s:22:"supplemental_address_2";s:0:"";s:4:"city";s:0:"";s:11:"postal_code";s:0:"";s:18:"postal_code_suffix";s:0:"";s:17:"state_province_id";s:0:"";s:10:"country_id";s:4:"1228";s:10:"geo_code_1";s:0:"";s:10:"geo_code_2";s:0:"";}s:5:"phone";a:3:{i:1;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:2;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:3;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}}s:5:"email";a:3:{i:1;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:2;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:3;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}}s:2:"im";a:3:{i:1;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:2;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:3;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}}}}s:4:"note";s:0:"";s:8:"custom_8";s:1:"X";s:8:"custom_9";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:9:"custom_10";s:0:"";s:9:"custom_11";a:0:{}s:9:"custom_15";a:1:{i:0;s:4:"NONE";}s:11:"_qf_default";s:9:"Edit:next";s:18:"_qf_Edit_next_view";s:4:"Save";}}s:5:"valid";a:1:{s:4:"Edit";b:0;}s:15:"_qf_button_name";s:18:"_qf_Edit_next_view";}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_1914_container|a:4:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:0:{}}s:5:"valid";a:1:{s:4:"Edit";N;}}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_5390_container|a:4:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:0:{}}s:5:"valid";a:1:{s:4:"Edit";N;}}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_8311_container|a:5:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:31:{s:5:"qfKey";s:37:"212654f6fe741db2cf66b7de389bae46_8311";s:9:"prefix_id";s:0:"";s:10:"first_name";s:2:"as";s:11:"middle_name";s:1:"f";s:9:"last_name";s:4:"afds";s:9:"suffix_id";s:0:"";s:9:"nick_name";s:0:"";s:13:"greeting_type";s:6:"Formal";s:9:"job_title";s:0:"";s:13:"deceased_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:10:"birth_date";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:13:"shared_option";s:1:"0";s:16:"create_household";s:0:"";s:16:"shared_household";s:0:"";s:8:"home_URL";s:0:"";s:16:"current_employer";s:0:"";s:14:"contact_source";s:0:"";s:2:"ct";s:10:"Individual";s:19:"external_identifier";s:0:"";s:7:"privacy";a:4:{s:12:"do_not_phone";s:0:"";s:12:"do_not_email";s:0:"";s:11:"do_not_mail";s:0:"";s:12:"do_not_trade";s:0:"";}s:30:"preferred_communication_method";a:3:{i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";}s:21:"preferred_mail_format";s:4:"Both";s:8:"location";a:1:{i:1;a:7:{s:16:"location_type_id";s:1:"1";s:10:"is_primary";s:1:"1";s:4:"name";s:0:"";s:7:"address";a:10:{s:14:"street_address";s:0:"";s:22:"supplemental_address_1";s:0:"";s:22:"supplemental_address_2";s:0:"";s:4:"city";s:0:"";s:11:"postal_code";s:0:"";s:18:"postal_code_suffix";s:0:"";s:17:"state_province_id";s:0:"";s:10:"country_id";s:4:"1228";s:10:"geo_code_1";s:0:"";s:10:"geo_code_2";s:0:"";}s:5:"phone";a:3:{i:1;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:2;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}i:3;a:2:{s:10:"phone_type";s:0:"";s:5:"phone";s:0:"";}}s:5:"email";a:3:{i:1;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:2;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}i:3;a:2:{s:5:"email";s:0:"";s:7:"on_hold";s:0:"";}}s:2:"im";a:3:{i:1;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:2;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}i:3;a:2:{s:11:"provider_id";s:0:"";s:4:"name";s:0:"";}}}}s:4:"note";s:0:"";s:8:"custom_8";s:1:"X";s:8:"custom_9";a:3:{s:1:"M";s:0:"";s:1:"d";s:0:"";s:1:"Y";s:0:"";}s:9:"custom_10";s:0:"";s:9:"custom_11";a:0:{}s:9:"custom_15";a:1:{i:0;s:4:"NONE";}s:11:"_qf_default";s:9:"Edit:next";s:18:"_qf_Edit_next_view";s:4:"Save";}}s:5:"valid";a:1:{s:4:"Edit";b:0;}s:15:"_qf_button_name";s:18:"_qf_Edit_next_view";}_CRM_Core_Controller_Simple_212654f6fe741db2cf66b7de389bae46_1637_container|a:4:{s:8:"defaults";a:0:{}s:9:"constants";a:0:{}s:6:"values";a:1:{s:4:"Edit";a:0:{}}s:5:"valid";a:1:{s:4:"Edit";N;}}

Never used IRC, but willing to try it. I have both Linux Fedora 6 and Windows systems to work on.

What should I check next?

$cott


sdybiec

  • Guest
Re: A non-recoverable error: Could not find valid value for ct
September 15, 2007, 06:38:04 am
Been doing some more work.

Inserted some logging stmts just before line 152 in civicrm/CRM/Contact/Form/Edit.php to see if the session was alive and well:

if ( $this->_action == CRM_Core_Action::ADD ) {

            watchdog('CRM Edit::preprocess:add', sprintf('_SESSION = %s', print_r($_SESSION, true)), WATCHDOG_NOTICE);
            watchdog('CRM Edit::preprocess:add', sprintf('CiviCRM_session = %s', print_r($_SESSION, true)), WATCHDOG_NOTICE);
       
            $this->_contactType = CRM_Utils_Request::retrieve( 'ct', 'String',
                                                               $this, true, null, 'REQUEST' );

The session is there for both the POST and GET, so I dug further into the session code. Added logging lines to Session:: get():

/**
     * Gets the value of the named variable in the session scope
     *
     * This function takes a name and retrieves the value of this
     * variable from the session scope.
     *
     * @access public
     * @param  string name  : name  of the variable
     * @param  string prefix : adds another level of scope to the session
     * @return mixed
     *
     */
    function get( $name, $prefix = null ) {
        // create session scope
        $this->create();
        $this->createScope( $prefix );

        if ($name == 'ct') {
          watchdog('Session::get', sprintf('_session = %s, prefix = %s', print_r($this->_session, true), $prefix), WATCHDOG_NOTICE);
        }

Somethings up with the $prefix, I think. After I hit "Add Individual" and the form is created, here's what the session looks like:

_SESSION = Array ( [CiviCRM] => Array ( [domainID] => 1 [ufID] => 1 [userID] => 102 [ufEmail] => scott@humanfactor.com [CRM_Contact_Page_View_DashBoard] => Array ( [action] => 4 [displayName] => Scott Dybiec [contactImage] => Individual  [columnHeaders] => Array (
  • => Array ( [name] => Activity [sort] => activity_type [direction] => 4 ) [1] => Array ( [name] => Subject ) [2] => Array ( [name] => Created By ) [3] => Array ( [name] => With Contact ) [4] => Array ( [name] => Scheduled [sort] => date [direction] => 1 ) [5] => Array ( [name] => Status ) [6] => Array ( [desc] => Actions ) ) [rows] => Array ( ) [rowCount] => 0 [rowsEmpty] => 1 [qill] => [crmPID] => 0 [crmSID] => 1 [crmSortDirection] => 1 [crmSortOrder] => date asc [crmRowCount] => 50 ) [CRM_Utils_Recent] => Array (
  • => Array ( [title] => Scott Dybiec [url] => http://uaprogressiveaction.com/civicrm/contact/view?reset=1&cid=102 [icon] => Individual  [id] => 102 ) ) [qfPrivateKey] => 51db578fb028b6cc225f4a70ab5c300e82ad6dd4c032c4841e120711bee0b416 [qfSessionID] => d66a83b0060d58e418d65e6ffd55ab2d [CRM_Contact_Form_Edit_b330d22fefbc1d9c50dae2208b585816_3336] => Array ( [qfKey] => b330d22fefbc1d9c50dae2208b585816_3336 [action] => 1 [ct] => Individual ) [uploadNames] => Array ( ) ) [watchdog_overview_filter] => all [_CRM_Core_Controller_Simple_b330d22fefbc1d9c50dae2208b585816_3336_container] => Array ( [defaults] => Array ( ) [constants] => Array ( ) [values] => Array ( [Edit] => Array ( ) ) [valid] => Array ( [Edit] => ) ) )


Looks like the form was created and values were stored with prefix: CRM_Contact_Form_Edit_b330d22fefbc1d9c50dae2208b585816_3336

Then after I fill in the form and press "Save", here's what the session looks like:

_session = Array ( [CiviCRM] => Array ( [domainID] => 1 [ufID] => 1 [userID] => 102 [ufEmail] => scott@humanfactor.com [CRM_Contact_Page_View_DashBoard] => Array ( [action] => 4 [displayName] => Scott Dybiec [contactImage] => Individual  [columnHeaders] => Array (
  • => Array ( [name] => Activity [sort] => activity_type [direction] => 4 ) [1] => Array ( [name] => Subject ) [2] => Array ( [name] => Created By ) [3] => Array ( [name] => With Contact ) [4] => Array ( [name] => Scheduled [sort] => date [direction] => 1 ) [5] => Array ( [name] => Status ) [6] => Array ( [desc] => Actions ) ) [rows] => Array ( ) [rowCount] => 0 [rowsEmpty] => 1 [qill] => [crmPID] => 0 [crmSID] => 1 [crmSortDirection] => 1 [crmSortOrder] => date asc [crmRowCount] => 50 ) [CRM_Utils_Recent] => Array (
  • => Array ( [title] => Scott Dybiec [url] => http://uaprogressiveaction.com/civicrm/contact/view?reset=1&cid=102 [icon] => Individual  [id] => 102 ) ) [qfPrivateKey] => 51db578fb028b6cc225f4a70ab5c300e82ad6dd4c032c4841e120711bee0b416 [qfSessionID] => d66a83b0060d58e418d65e6ffd55ab2d [CRM_Contact_Form_Edit_b330d22fefbc1d9c50dae2208b585816_3336] => Array ( [qfKey] => b330d22fefbc1d9c50dae2208b585816_3336 [action] => 1 [ct] => Individual ) [uploadNames] => Array ( ) [numberDomains] => 1 [CRM_Contact_Form_Edit_b330d22fefbc1d9c50dae2208b585816_4290] => Array ( [qfKey] => b330d22fefbc1d9c50dae2208b585816_4290 [action] => 1 ) ) [watchdog_overview_filter] => all [_CRM_Core_Controller_Simple_b330d22fefbc1d9c50dae2208b585816_3336_container] => Array ( [defaults] => Array ( ) [constants] => Array ( ) [values] => Array ( [Edit] => Array ( [qfKey] => b330d22fefbc1d9c50dae2208b585816_3336 [prefix_id] => 1 [first_name] => fd [middle_name] => g [last_name] => dfger [suffix_id] => [nick_name] => [greeting_type] => Formal [job_title] => [deceased_date] => Array ( [M] => [d] => [Y] => ) [birth_date] => Array ( [M] => [d] => [Y] => ) [shared_option] => 0 [create_household] => [shared_household] => [home_URL] => [current_employer] => [contact_source] => [ct] => Individual [external_identifier] => [privacy] => Array ( [do_not_phone] => [do_not_email] => [do_not_mail] => [do_not_trade] => ) [preferred_communication_method] => Array ( [1] => [2] => [3] => ) [preferred_mail_format] => Both [location] => Array ( [1] => Array ( [location_type_id] => 1 [is_primary] => 1 [name] => [address] => Array ( [street_address] => [supplemental_address_1] => [supplemental_address_2] => [city] => [postal_code] => [postal_code_suffix] => [state_province_id] => [country_id] => 1228 [geo_code_1] => [geo_code_2] => ) [phone] => Array ( [1] => Array ( [phone_type] => [phone] => ) [2] => Array ( [phone_type] => [phone] => ) [3] => Array ( [phone_type] => [phone] => ) ) [email] => Array ( [1] => Array ( [email] => [on_hold] => ) [2] => Array ( [email] => [on_hold] => ) [3] => Array ( [email] => [on_hold] => ) ) [im] => Array ( [1] => Array ( [provider_id] => [name] => ) [2] => Array ( [provider_id] => [name] => ) [3] => Array ( [provider_id] => [name] => ) ) ) ) [note] => [custom_8] => X [custom_9] => Array ( [M] => [d] => [Y] => ) [custom_10] => [custom_11] => Array ( ) [custom_15] => Array (
  • => NONE ) [_qf_default] => Edit:next [_qf_Edit_next_view] => Save ) ) [valid] => Array ( [Edit] => ) [_qf_button_name] => _qf_Edit_next_view ) [messages] => Array ( [status] => Array (
  • => You have been successfully subscribed. ) ) [_CRM_Core_Controller_Simple_b330d22fefbc1d9c50dae2208b585816_4290_container] => Array ( [defaults] => Array ( ) [constants] => Array ( ) [values] => Array ( [Edit] => Array ( ) ) [valid] => Array ( [Edit] => ) ) ) , prefix = CRM_Contact_Form_Edit_b330d22fefbc1d9c50dae2208b585816_4290


Notice the prefix at the end of this log line. This log line was printed from w/i Session.php. It seems to have created another form and stored that in the session, then looked for the value for 'ct' there.

What could cause this?

$cott


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: A non-recoverable error: Could not find valid value for ct
September 15, 2007, 12:10:08 pm

sorry, such issues are incredibly hard to debug and trace.

If i had to guess, your session is getting corrupted OUTSIDE of civicrm. I dont think u'll find it tracing the code in CiviCRM. Here's the flow:

drupal init -> read session from db -> modify session -> civicrm -> modify session -> drupal -> modify session -> write
                                       
and since we follow the PRG pattern, we expect the session to be consistent:

i.e. what we wrote in the POST should be retrieved in the GET

Your below session debug with the differing prefixes illustrates that. We create a new prefix/key since the old session was lost and we could not retrieve the "private form key". hence we no longer have the ct, hence the error

the question is why did the session change between the two requests in CiviCRM. So i would probably trace it in drupal's session code specifically the read and write functions and then go backwards.

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

sdybiec

  • Guest
Re: A non-recoverable error: Could not find valid value for ct
September 15, 2007, 01:21:41 pm
OK, I'll do that and let you know what I find. I did some more work in the meantime and have a question.

Invoke::form() is trying to find a file it will never find due to a missing forward slash in the file name:

} elseif ( file_exists( realpath (dirname( __FILE__ ) . "../Contact/Form/{$contact_type}.php" ) ) ) {

would need to be:

} elseif ( file_exists( realpath (dirname( __FILE__ ) . "/../Contact/Form/{$contact_type}.php" ) ) ) {

However, once I made this change, I got an error that Individual.php does not implement the function getAttributes().

Is Individual.php supposed to be used for editing an individual?

$cott


Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • A non-recoverable error: Could not find valid value for ct

This forum was archived on 2017-11-26.