Closed (fixed)
Project:
Webform CiviCRM Integration
Version:
7.x-2.x-dev
Component:
CiviCRM Data Handling
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2011 at 22:59 UTC
Updated:
8 Mar 2012 at 06:10 UTC
Comments
Comment #1
colemanw commentedInteresting. I've never used that module before, but I suspect this may be a core civicrm issue as well, since this module just grabs the cid from CiviCRM's session variable.
Have you experimented with core profiles and such to see if they are also misbehaving?
Quick fix: in the file webform_civicrm_utils.inc on line 1431, change this:
to this:
That should fix it for you (temporarily, but you don't want to have to hack this module every time you upgrade). Getting CID from the session instead of from the API gives a performance boost though, so it would be interesting to find out why this variable isn't getting updated by Civi core and what it would take to do so. Wanna ask about it in the forums or IRC and post back here?
Comment #2
BasH commentedThanks a lot!! It saved me a lot of searching. I was trying to change something like this but in the wrong include file (-:. And this works perfectly.
I am still constantly changing and testing our site, but untill now this was our only problem while masquerading, so no problems with the core profile(s) yet (but I'll keep your warning in mind).
I don't know if this fix really affects the performance, but if this also can be or has to be changed somewhere else in the Civicrm code, maybe it is worth asking around in the forums (do you have a specific forum in mind?).
But on the other hand I thought this wasn't a problem in the previous version of Webform CiviCRM Integration, and checking the utils include file showed me that the global user was used there. So maybe this should be a permanent fix in this or a next version, because the value in the session might be used (I don't know..) for switching back to that user, and in that case it cannot be changed and used while masquerading!
By the way, I am glad I didn't have to revert to the previous version because you have to rearrange all the fields of all (civicrm) webforms when you upgrade to this new 2.2 version. That is worth mentioning (in for instance the install/upgrade notes) to users that still have to upgrade, I think!
For me this was a lot of work when I installed version 2.2., you have to check and change the position and length of every field again (!!), however, it is a real improvement especially because of being able to select and update the correct home/work phonenumber/emailaddress etc. of a contact. Thanks for your work!
Comment #3
colemanw commentedI have not committed the code in #1, so you will need to manually port it to 2.3 when upgrading.
Instead I filed an issue with the core team to see if we can address it there.
http://issues.civicrm.org/jira/browse/CRM-9255
Comment #4
colemanw commentedI am going ahead and committing this fix. The bug in Civi doesn't seem like it will be resolved anytime soon, so this makes sense for now.
Perhaps in the future there will be a standard way in Civi for getting the logged-in user's cid, and we can switch to that when it becomes available.