Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Apr 2011 at 07:27 UTC
Updated:
29 Jul 2014 at 19:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
skwashd commentedHere is the patch which implements it.
Comment #2
catchPatch looks good, I'm not sure the hook should start with "Inform other modules", although that's from other comments in the same file so not for this patch to worry about.
This is just adding a hook that's missing (and it's silly to have insert/update hooks without presave), so it makes sense to me to backport it to D7.
Comment #3
larowlanLooks good to me.
Comment #4
skwashd commented@catch I agree the docs aren't great, but it is consistent with the language used for the other hooks which handle saving roles.
Comment #5
catchYep, we should clean up the docs in another issue all in one go, not here.
Comment #6
dave reidFeels like this needs a few comment tweaks...
Should be "Act on a user role being inserted or updated." to fit with existing first lines of exiting hook_entity/THING_presave()s.
Let's add a comment here (again consistency with our other THING_save() comments):
// Let modules modify the user role before it is saved to the database.Powered by Dreditor.
Comment #7
catch@Dave - the first one has already been discussed - the comments in user.api.php all need fixing, so we should open a separate issue to fix them in one go (or alternatively fix them all here but that's not really in scope).
I agree it's worth adding a comment by the module_invoke_all() though, so CNW for that at least.
Comment #8
skwashd commentedRerolled with additional comment as per @6
Comment #9
catchLooks good, let's do comment cleanup in another issue.
Comment #10
skwashd commentedThere is now a docs clean up issue - #1120440: user.api.php hook summary lines should be more consistent with other entity hooks
Comment #11
dave reidYeah I know the other docs need cleanup, just not sure why we can't make that change here for this function since its new...
Comment #12
dries commentedThe example is a bit silly. It would be helpful to have a helpful example. If not in the example code, maybe explain in the documentation _why_ this is a useful hook.
Comment #13
skwashd commentedRerolled
I agree the example is a bit silly. I was trying to find something generic to demonstrate it. The docs have been updated.
Comment #14
gordon commentedThis patch looks fine, however I do agree with @skwashd in that using an example from uuid is too specific for an example.
However we do have issue #1120440 which is a clean up of user.api.inc so we should most likely revisit it there.
+1 RTBTC
Comment #15
dries commentedThis looks good.
Committed to 7.x and 8.x.