I want to add extra fields to GalleryUser, such as forget password question/answer etc.
What's the best way to extending GalleryUser?
I've thought of using callback to 'hook' the add/delete of GalleryUser entity, something like UserAlbum does. This may requires writing a new entity and new map to user.
Another approach is to inherit from GalleryUser, add fields to it, then copy the Register module and change it to create my new version of GalleryUser. However, I don't know if there're any other places that will create GalleryUser (beyond Register module).
Which way is better (faster and easier)? Callback or inheriting?
Posts: 32509
your approach is good and it's a viable approach.
but since the wish to add more user profile fields / data is quite general, I guess we should create a "profile" module or "custom fields" for user entities.
then you could either add new fields in an admin interface, or you could expose an API to other modules, such that they can add further fields.
we can then either create a new system link parallel to "Your Account" and call it "Profile". or we could change the core module Your Account view / controller to allow other modules to hook in UserProfileOptions or something like that.
Posts: 5
I think I will go for callback/hook approach since seems all other modules doing that.