Just noticed that T&C saves the entire text in every user record, leading to some serious data bloat. I'll provide a patch when I can since there are some other issues with Legal that have been bothering me.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | legal.users_.data_.patch | 3.06 KB | Steven |
| #3 | legal.module-diff-2007-06-03-22-40-00_0.patch | 1.29 KB | john.money |
| #2 | legal.module-diff-2007-06-03-22-40-00.patch | 1.28 KB | john.money |
Comments
Comment #1
robert castelo commentedYes, that's a bug.
Patch would be welcome.
Please make sure to provide a separate patch for each bug fixed and feature added. Makes it quicker to review and commit.
Comment #2
john.money commentedThe following patch will cleanup the user data variable bloat. Normally, I wouldn't be concerned about it, but since the entire T&C is stored in every user record, it needed an immediate fix. Note that this patch will NOT work if you are using other contributed modules that hijack the user_register_submit function and do not return control to it (e.g. Logintoboggan, Invite, etc). You will need to manually clear the variables in the appropriate xxx_user_register_submit function.
Also, if you want to cleanup your existing user records, one solution would be to:
1. create a new T&C version so that all users have to accept
2. add the following to your login.module which is not incorporated into the attached patch since it is not needed for new/virgin installations
GW
Comment #3
john.money commentedIgnore previous patch... bad function name. Attached is corrected.
Comment #4
Gman commentedI have been looking into this issue as well. But our site uses LoginToboggan, so your patch will not work for us.
I think an approach would be the three places that 'legal_save_accept(...)' is called, to remove the associated $edit or $account entries that you remove in your patch.
I believe that approach will work more generally to make this module play well with others. I may be able to offer a patch along those lines.
Comment #5
john.money commentedLoginToboggan never passes control back to user_register_submit which is not so much a fault with LoginToboggan but with the limitations of the user module. At any rate, if you unset the legal variables within logintoboggan_user_register_submit, it will work like this:
Inicidentally, the second mod I list above are orphaned form variables which user.module cleans up but LoganToboggan does not. Can't provide a patch that covers all these possibilities since every module that hooks into user.module registration will have these same problems.
Comment #6
Steven commentedRiiiiight.
And here's a patch that doesn't do crazy stuff and just uses the normal documented way of preventing variables from spilling into the users.data column.
It also cleans up the screwed up users table the sane way, with a multi-part update, rather than adding a permanent piece of code just for legacy purposes.
I removed the 'extras' values from the data column too, since the stored values are only used when the terms and conditions change, and there are no guarantees that the old checkboxes match the new ones.
The legal.module chunks aren't code-style compliant, but then neither is the surrounding code.
Comment #7
Steven commentedComment #8
robert castelo commented