Summary
Editing old webform submissions updates the CiviCRM record when the edit is saved.
This is useful but may not always be the desired behaviour.
Proposed resolution
Make this functionality configurable (enabled/disabled) per webform. So you can decide per webform whether editing submissions should call the API to update CiviCRM again.
The default should be for this functionality to be enabled.
A status message could also be used when editing webform submissions, so say whether updating the submission will cause CiviCRM to be updated or not.
Example use case
If you have a survey that also provides an address form. A while later an admin edits a single survey response and saves it. The originally submitted address the overwrites the address in CiviCRM, regardless of whether any changes have occurred in the mean time.
Comments
Comment #1
colemanw commentedI'd call this another case of "expected behavior depends on your expectations."
And in a lot of cases I think updating a submission and having it update the civicrm record is expected. Certainly it's what I had in mind when I wrote that part of the module. For example:
- Provide event participants a link where they can modify their registration info via updating their submission
- Allow applicants for a job/grant/etc to update their application info
The most robust solution might be to allow this behavior to be configured and disabled on a per-form basis. Let me know if you're interested in sponsoring that feature.
Additions to the documentation would always be welcome too :)
Comment #2
jkingsnorth commentedI hadn't considered this :] (I suppose that particular feature gets tricky with payment gateways and people editing paid ticket options...)
I would be happy to add this as a note in the documentation for the module when I get the chance, so that would cover #1. Configuring it per form would be the most flexible option, unfortunately not something I would be able to work on at the moment.
Thanks as ever colemanw.
Comment #3
jkingsnorth commentedI've updated the documentation and I'm re-purposing this issue to accommodate coleman's suggestion of having this configurable per webform.
Comment #4
SpencerCampbell commentedCurrently, the way this works, any anonymous user can make changes to any CiviCRM contact record, provided they know enough of the person's contact information to make the module decide it's the same person.
This doesn't cause loss of data, since the changes can be reverted, but it's a pretty major security vulnerability, nonetheless. So, I hope I'm justified in bumping this issue all the way up to the bug category and critical priority, even though this is my first submission to the Drupal issue system. (I checked the issue queue handbook. It seems to fit.)
The problem seems to lie in the fact that the data is transferred to CiviCRM at the point of submission, and not at the point of confirmation. This means the data is taken in at face value whether or not the person submitting it actually has access to the email address that they provide.
At the moment, this shouldn't even be configurable, in my opinion. CiviCRM already has sophisticated functions for merging contact data. This module should only create new contacts, ever, no exceptions. Right now it's trying to do CiviCRM's job, and it's doing it poorly.
Forgive me if I'm missing something obvious here. We're just in the process of adopting CiviCRM at my company, it's my job to have the webform working before the 4th, and I just found out about this problem today. I'd rather not have thousands and thousands of people directed to a webform with a gaping security hole like this, if I can help it.
I hope somebody out there who knows more Drupal than I do sees this soon.
Thanks for reading!
Comment #5
jkingsnorth commentedCould you clarify what you mean by:
This issue specifically relates to editing webform submissions, which (normally) you can only do if you are logged in as the user that submitted the webform in the first place. (Or if you're an admin on the form)
As far as I understand the module, you can turn off the matching to an 'Existing contact' but unticking that box in the CiviCRM > Contact fields area of the webform. Then the module will always create new records, so they can be manually deduped? Let me know if that's not the case though.
I'm not sure when the module would automatically match you to someone and overwrite the information in CiviCRM, but again do correct me if I'm wrong or provide some information about how to create this issue.
Comment #6
petednz commentedwould it be useful to clarify the issues here by comparing them to how civi profiles would behave in the same scenario?
Comment #7
colemanw commentedWhoops looks like this issue just got sidetracked. Since we're already going down this road I'll respond, but recommend creating a new issue if there needs to be any follow-up discussion about questions unrelated to updating webform submissions.
Spencer, welcome to the CiviCRM community. Glad to have you here. If you haven't already please have a read of the CiviCRM users guide and the instructions for this module. It's a lot of material to cover and I'm sure you'll have more questions, which you can ask on the CiviCRM StackExchange site.
You are asking some important questions while trying to learn a complex new system. As you learn I'd encourage you to keep an open mind and avoid jumping to conclusions about what Civi or this module "should" do. To address your points:
If you have more questions, please feel free to ask on the CiviCRM StackExchange site.
Comment #8
colemanw commented@SpencerCampbell a good place to continue this discussion would be over at #1378900: Allowing for the Matching Rule to be specified per Form or even per Contact
Comment #9
SpencerCampbell commented@John.K
Now that I read it again, I realize I misread the original issue. My issue is about webform users updating their information by making new submissions, not about users or administrators updating the submissions themselves directly. Sorry for the confusion!
@colemanw
Wow! I only read your reply just now, and I wish I had read it earlier. I'll take your advice. Thank you. And thank you for your patience with my flailing attempts to make sense of a tool I know very little about. Next time I think I've found a security hole, I'll go through the proper channels.
Comment #10
jkingsnorth commentedNo worries [:
Comment #11
colemanw commented@SpencerCampbell glad to help :) Good luck with your site launch.
Comment #12
mpaulson commentedThis issue was filed against a branch (7.x-4.x) that is no longer supported. We're sorry we did not get to work through it, but once you upgrade to 7.x-5.x and if the issue persists, please feel free to re-open.