Changes to profile_execute_on_save

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Changes to profile_execute_on_save
« on June 25th, 2012, 06:29 AM »
I'd like several changes to be made to profile_execute_on_save:

o Since it is what amounts to a hook, use call_hook
o Rename to something like profile_save
o Move it above the error trap, approx. line 630
o Pass some variables to it - $memID, $post_errors

Could that be done?
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Changes to profile_execute_on_save
« Reply #1, on July 4th, 2012, 01:09 AM »
I agree certainly with the last two points, because that means you can handle saving, as well as throwing back errors etc.

Renaming? Yes, it would be nicer that way.

As far as making it a hook goes, yes, that's the sort of thing that should be a hook but the way it appears to be implemented could get interesting since it requires the ability to be able to selectively remove an item from the chain.

Off the top of my head I forget exactly how the hooks array ends up being, whether it is feasible to have hooked functions that function like that. Also, there is one stated use of that hook, which is what all the effort goes to - the question I have is what priority the existing hooked function should then have?

Basically, Profile-Modify.php lines 755 adds a function to that stack to reload the user if we're making a change and the current user is the user being changed (so we forcibly update the user information), but I would imagine that needs to be pretty much the last thing we do, no?
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial