-
- 24,544 Posts
Sorry, if I'm being dense, but I don't know what you mean by 'database ID'. The name of the DB? The ID used to log in to the DB? The DB's name? The current user's user ID? The email recipient's user ID?
-
- 35 Posts
You are most certainly not being dense. I, on the on the other hand, am pretty dense when it comes to this kind of stuff. So please bear with me.
To make one correction I meant the FormItSaveForm hook not the FormSave hook.
To clarify about the 'database ID' what I meant was the id used to log in to the DB (the incremented id number).
In the table 'modx_formit_forms' to be specific.
Hope that makes sense
-
- 24,544 Posts
Ah, that's a new feature. I couldn't find any docs for it anywhere.
Looking at the code, I couldn't really tell what it's supposed to be used for, so the following is pure speculation on my part.
It looks like if you add a hidden input field named savedFormHashKey, the FormItSaveForm hook snippet will create a hash (id) and put it's value in a hook variable called savedFormHashKey. I think later hooks in the chain can then get the hash with $hook->getValue('savedFormHashKey'). As far as I can tell, the autoincrement ID field is never used for anything. Form data is retrieved from the table by the hash value.
If the form's contents don't need to be ultra-secure, FormIt2DB might be an easier way to go.
Take my advice with a grain of salt. I never use any part of the FormIt package and I've never used FormIt2DB. I generally roll my own form snippets so I can step through them in my debugger.