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) »
  • losing cid when adding contact to a group
Pages: [1]

Author Topic: losing cid when adding contact to a group  (Read 1063 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
losing cid when adding contact to a group
September 07, 2010, 06:31:17 am
We are getting some occasional odd behaviors when adding a contact to a group via the contact's group tab. After initiating the save, we occasionally receive an error: "Could not find valid value for cid". But the error is only reproducible when you first login to the system and visit a record. Once you've been using the system, it cannot be reproduced.

The backtrace reveals the breakdown is in: civicrm/CRM/Utils/Request.php, fatal
This is triggered from: CRM/Contact/Page/View/GroupContact.php, around line 90
in preProcess, the cid value is retrieved and then used to control redirection back to the contact record's group tab
it seems that in some situations, the cid value cannot be retrieved via the $_GET variable

anyway, I've fixed it by adding some code to retrieve the contact id via the session variable if the $_GET retrieval is unsuccessful, and it's working fine. but i'd like to get to the bottom of why this would happen.

I've compared url construction for instances when the group save works, and when it doesn't, and they are identical. before triggering the group save, the cid var is definitely part of the url string. since that function call is part of preProcess, I'm understanding that on save, civi first retrieves this value, then process the function to add the contact to the group, then returns via the constructed url. what could be getting in the way of that GET retrieval?

i have not been able to replicate on the sandbox, but it's a quirky bug that is difficult to reproduce reliably, so that may just be because i haven't tried enough to recreate. mostly i'm looking for suggestions on why this might be happening as i prefer to address the root problem.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • losing cid when adding contact to a group

This forum was archived on 2017-11-26.