Hi all,
I was looking at hook_forms() implementations in core and I came across user_forms(). Checking it out, it seems that the callback - user_admin_access_form() - no longer exists in D7 or D8.
It did exist in D6 but I'm guessing that user_forms() is no longer used and can be removed? Unless I have completely misunderstood how hook_forms() works?
user_forms() is also referred to in comments in a few files - such as form.inc .
--
So basically, I think we need to:
a) remove the user_forms() function from the user module
b) remove all other references to user_forms() within Drupal - in comments basically
c) backport the above to D7 (not sure if we backport this kind of change though?)
I'm happy to do this myself once I have confirmation that I am not completely wrong on this (a possibility given my noobiness).
Thanks,
nicl
Comment | File | Size | Author |
---|---|---|---|
#10 | 1316866-user-forms.patch | 2.8 KB | Niklas Fiekas |
#6 | user_forms_reduntant-1316866-6.patch | 2.84 KB | nicl |
#5 | user_forms_reduntant-1316866-5.patch | 10.43 KB | nicl |
Comments
Comment #1
nicl CreditAttribution: nicl commentedJust to clarify, I did look for whether user_forms() was called anywhere but couldn't find any instances where it is for D7/8. But again, verification would be great!
Comment #2
xjmGuess we can call this a cleanup task. It's backportable.
user_forms()
would not be called directly since it is a hook implementation. However, since it's not doing anything and the forms it's routing no longer exist, we should get rid of it.Results are the same in both 7.x and 8.x branches:
So, the callbacks no longer exist, the base form no longer exists, and we should remove all references to all of them.
Comment #3
nicl CreditAttribution: nicl commentedAh yes, of course it won't be called directly. Pretty stupid of me! Thanks xjm, I'll work on a patch this weekend.
Comment #4
xjmTagging.
Comment #5
nicl CreditAttribution: nicl commentedPatch for D8, D7 will follow shortly...
UPDATE: Erm, I included another patch in that, so please ignore.
Comment #6
nicl CreditAttribution: nicl commentedOk, should be right this time...
Comment #7
watbe CreditAttribution: watbe commentedCan't find anything wrong with it.
Comment #8
sunhook_forms() is still an actively used Form API hook.
What matters here is the referenced 'callback' of
user_admin_access_form()
, which no longer exists since D7.Hence, this is good to go.
Comment #9
Dries CreditAttribution: Dries commentedAlright! Committed to 8.x. Thanks.
Comment #10
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedRerolled for D7.
Comment #11
xjmBackport looks good as well.
@webchick: If you look at this and go "How is this backportable again?" like I just did, see #2. (I suppose if we wanted to be extra-cautious in case some misled person is calling
user_forms()
directly, we could backport only the documentation fixes...)Comment #12
webchickNice catch. Thanks for explaining why this was safe, because it did indeed look a bit sketchy. :)
Committed and pushed to 7.x. Thanks!