Legal currently stores a copy of the entire T&C in every user profile. This (at a minimum) populates two database tables (main field data & revisions). My project has a very large T&C document, and about 15,000 users - this leads to an enormous waste of space in the database, and significantly slows down database exports and imports. I'm guessing the idea is to store an exact copy of the T&C that the user agreed to. Why not store revisions of the T&C in a separate table, and only save the ID of the appropriate revision in the user profile?

Comments

robert castelo’s picture

Category: feature » bug

If it's storing T&Cs in Profile that's definitely a bug - changing category.

Which profile module are you using?

yuriy.babenko’s picture

Hmm, didn't occur to me that this might be a bug. Seemed intentional.

I'll run you through this project's setup (I didn't build it, so I may not be aware of some things, but will do my best to cover everything related):

There is Profile2 (7.x-1.2) enabled; that's the only enabled profile module. On /admin/config/people/accounts/fields I've got a field called 'field_user_legal' (textarea w/ multiple rows). This is the field which gets populated with the T&C. Interestingly, a grep of the entire /sites/all folder for 'user_legal' didn't turn up anything useful (only results were this field being included in a Features module, and this field getting disabled on the user registration via a custom form_alter hook).

Legal's legal_form_user_register_form_alter() looks to be adding a $form['legal'] element, but I'm not sure what actually saves it in the profile; maybe the profile2 module automatically saves all data in $form as fields? Haven't looked at the code yet...

osopolar’s picture

Status: Active » Closed (cannot reproduce)

I installed the module and can't see the field field_user_legal. Probably there is some custom code responsible for this behavior.

yuriy.babenko’s picture

Status: Closed (cannot reproduce) » Active

osopolar, let's let the module maintainers make a call on the issue status. I haven't used Legal since opening this issue a while back, so it may or may not still be a problem, but it's best for the module devs to confirm that.

robert castelo’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

Not caused by Legal module, maybe an issue with Profile2?