No notifications on profile fields

glen201 - October 25, 2009 - 21:36
Project:User registration notification
Version:6.x-1.11
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs work
Description

Hi, the module is not notifying on profile updates EXCEPT when users create accounts requiring administrator approval I get a message (although the code implies that I should not) and then I get an update notification ONLY after the administrator approves the user!

line 44 in user_register_notify.module:
  // Notify administrator of new user only if this is not first user and
  // if visitors can create accounts without administrator's approval.

After that, the user can change any profile field and their is no notification.

Can the maintainer point to the portion of code that is supposed to detect that a profile update occurred? Is it in function user_register_notify_user the case for 'update' that's supposed to check that a user updated their profile?

Something's not acting right.

--glen

#1

rmiddle - October 25, 2009 - 21:46
Status:active» needs work

I designed the module to only trigger on creation. Updated was added after someone requested it. I fire off the update email upon user change but it sounds like profile changes don't fire off the user update call. I will make a note to check and see if the profile_module has a hook to note a change. If it does I will attempt to grab that if it doesn't then I will note that.

Thanks
Robert

#2

glen201 - October 25, 2009 - 22:50

OK. Also check the profile data that you insert in the email - it is missing fields that are marked private.

Also, the subuser module, which creates users keyed to a primary user's account, doesn't cause email to be generated on user create.

Trigger provides support for actions on user profile update - you may want to key into that.

#3

rmiddle - October 25, 2009 - 23:07

At some point I want to key off of actions to handle lots of stuff but haven't had time to look up it's API to add support.

As for subuser module I have never heard of it but I wouldn't be surprised if it trigged for the wrong user upon update if it trigged at all.

In both 5.x and 6.x I have private fields and they seem to show up fine. Are you using the generic !profile or are you using field breakdowns?

Thanks
Robert

#4

glen201 - October 25, 2009 - 23:16

Yes, the generic !profile -- you're right, I should stuff in the specific field(s) I want into the email

As to actions, the table looks simple -- seems like you specify a callback hook on the action and store some parameters for when it's called.

The big issue for profile -- if you could solve it you'd be a hero to many -- is to be able to get information as to WHICH field in the profile was changed and only indicate those. I was just lurking in the profile_values table, there's no timestamp or serial # that you could track that gets updated. You'd probably have to copy the user's data to a temp table and then compare the resulting updated profile with the original to flag a field as changed -- that's one approach off-the-top. Without it, the recipient of the notification has to scan some other list manually to see what the user actually changed.

--glen

#5

glen201 - October 26, 2009 - 22:28

I found the problem -- the complex if statement at the beginning of function user_register_notify_setup_email is too restrictive. If new users require administrative approval, then the if will fail for both insert and update!

--glen

P.S. The missing profile fields are the default profile behavior -- as you fill out optional portions of your profile, those fields get created (post-login) and then will be picked up by !profile. So that's working fine.

P.S2. The title for $form['user_register_notify_alert'] should be 'Notification' not 'Page Sort order' -- bad copy-paste job :)

#6

rmiddle - November 3, 2009 - 22:07

OK as I am tiring to catch up I need to look over the restrictions to see if I can light them some.

Thanks
Robert

 
 

Drupal is a registered trademark of Dries Buytaert.