Closed (fixed)
Project:
Webform
Version:
5.x-2.4
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2009 at 06:35 UTC
Updated:
12 Feb 2010 at 00:12 UTC
For my sign-up application, I'd be very happy if I can cause the uid of a submission to change. This would happen if a form is submitted by another party or an anonymous party, but is validated to be a user. (Sample snippet available to those interested)
I'd like to change the uid from "0" to the uid of the person identified. Can that be done in the advanced features, or must I do some external code?
Thanks!
Comments
Comment #1
cayenne commentedMaybe a little clarity: I am not trying to change the user's uid, I am trying to associate the submission with the uid of a user identified elsewhere, either during validation, which I am doing now, or wherever I do the reassignment. Worse comes to worse, I can run a mySQL query from time to time, but I's like to do it at submit time.
Any clues?
Comment #2
cdale commentedEDIT: Sorry, below code is for D6. I'm not as familiar with D5, but a similar process should work.
I don't think this is possible to do using any feature offered by webform without modifying the webform code. You should be able to do it with a small amount of custom code however.
Something like the following *should* work, although I have not tested it. You would need to do this in a module.
Comment #3
cdale commentedHere is some code that should work for D5.
Comment #4
quicksketchJust to backup what cdale has said, there's no way to do this in Webform without custom coding. The approach he's used above is about as close as you can get.
Comment #5
cayenne commentedThank you both very much. I am not surprised that this does not work within Webform. The fix looks very implementable! I'll give it a try later this week and report back.
Comment #6
passa commentedhi,
I join this post having a similar pb.
I'd like to be able to alter a webform.
i try both solution:
Loading a webform is not calling any of those function ...
No "tptptpt" print and nothing is log ....
Any tips ?
thanks.
Comment #7
avior commentedHi
the code above had drupal 5 signature
so here is drupal 6 working code
Comment #8
quicksketchLooks like this got wrapped up. Support for writing custom code is no longer provided in the Webform queue, please do not reopen.