Page 1 of 1

Profile Edit Timing

PostPosted: July 30th, 2010, 9:14 pm
by martonic
Hi Jason,

I ran into something annoying. There may be nothing you can do about it, but here it is.

I entered a hook for "profile_update" to catch profile changes and update my account tables.

The trouble is that when this runs, any edits to "s2Member Custom Fields" have not yet been recorded to the database, and there seems to be no context in which they are available (the hook sends a user ID # and that's all). Regular changes (i.e. first name, last name, email) have been recorded and are available when the hook gets invoked.

Like I said, there's probably nothing you can do, but at least now you know about this issue.

Re: Profile Edit Timing

PostPosted: August 5th, 2010, 3:48 pm
by Jason Caldwell
Thanks for reporting this. I'll take a look to see what's possible.

@R/TODO :: profile editing hooks; availability of changed variables

Just to note. You will be updated automatically as these TODO items are addressed.

Re: Profile Edit Timing

PostPosted: August 10th, 2010, 3:18 pm
by Jason Caldwell
@RESOLVED/TODO :: profile editing Hooks.
After investigation, it seems that you're relying solely on the "profile_update" Hook.

Possible solutions for you:

1. See: /s2member/includes/functions/profile-modifications.inc.php
add_action("ws_plugin__s2member_after_handle_profile_modifications", "your_function");

2. Set your "profile_update" Hook with a lower priority than the default of 10 ( timing issue maybe ).

3. See: /s2member/includes/functions/users-lists.inc.php
There are some other Hooks provided by s2Member here that are related to admin panel updates.

Re: Profile Edit Timing

PostPosted: August 10th, 2010, 6:59 pm
by martonic
Hi Jason,

After trying several things, the following worked:

Code: Select all
    $hook = "profile_update";
    add_action($hook, "catch_profile_edit", 20);


(higher priority number = lower priority = runs later)

Thanks! :mrgreen:

Re: Profile Edit Timing

PostPosted: August 17th, 2010, 11:35 am
by Jason Caldwell
Thanks for reporting back on this.
Much appreciated.