Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
First reported here: http://api.drupal.org/api/drupal/modules%21user%21user.api.php/function/...
line 229 should be:
$edit['data']['mymodule_bar'] = $edit['mymodule_foo'];
Comment | File | Size | Author |
---|---|---|---|
#27 | hook_user_presave-1483664-25.patch | 679 bytes | nmudgal |
#17 | hook_user_presave-d7-1483664-14.patch | 679 bytes | nmudgal |
#15 | hook_user_presave-d8-1483664-14.patch | 688 bytes | nmudgal |
#10 | hook_user_presave-D8-1483664.patch | 690 bytes | nmudgal |
#9 | hook_user_presave-D7-1483664.patch | 681 bytes | nmudgal |
Comments
Comment #1
rafamd CreditAttribution: rafamd commentedAdded correct code sample and Novice tag.
Comment #2
rafamd CreditAttribution: rafamd commentedThis is also wrong in D8, see: http://api.drupal.org/api/drupal/core!modules!user!user.api.php/function...
Maybe the correction should be the opposite ? I mean:
$edit['data']['mymodule_foo'] = $edit['mymodule_bar'];
ps: unrelated, but where did $category param go in D8 version of hook_user_presave ?already found out... all the "category" mechanism was taken away.Comment #3
rafamd CreditAttribution: rafamd commentedComment #4
chertzogPatch attached.
Comment #5
chertzogD7 Patch.
Comment #6
rafamd CreditAttribution: rafamd commentedThanks chertzog!
Looking at your patches, seems the same line is removed and introduced both times. Shouldn't the correct new line be:
+ $edit['data']['mymodule_foo'] = $edit['mymodule_bar'];
??Comment #7
rafamd CreditAttribution: rafamd commentedrestore tag
Comment #8
rafamd CreditAttribution: rafamd commentedhummm ... taking another look at the example, I think I was a confused in #2 and #6 and would like to stick to the recommended solution in the original post (and improve the inline comment to make it more informative).
Something like this:
Comment #9
nmudgal CreditAttribution: nmudgal commentedPatch attached after updating as per comment.
Comment #10
nmudgal CreditAttribution: nmudgal commented8.x -> Patch attached after updating as per comment.
Comment #11
chertzognice catch. At first glance all that i saw as the problem was the "my_module" change. I didnt notice the "_foo" to "_bar" change.
Comment #12
jhodgdonThanks! Patch looks good; I'll get it committed soon.
Comment #13
nmudgal CreditAttribution: nmudgal commented@jhodgdon
It would my first commit to core then :-)
Thanks.
Comment #14
jhodgdonUh oh. Actually I just noticed that the comment doesn't seem to match the patch (mymodule_foo vs. my_module_foo, and same for bar).
Comment #15
nmudgal CreditAttribution: nmudgal commentedoops here is the updated patch.
Thanks
Comment #16
rafamd CreditAttribution: rafamd commentedThanks nmudgal, looks better now. Care to re-roll the 7.x patch also ?
Comment #17
nmudgal CreditAttribution: nmudgal commentedhere is one, just was waiting for review of 8.x.
Thanks
Comment #18
rafamd CreditAttribution: rafamd commentedThanks !
Comment #20
boombatower CreditAttribution: boombatower commented#17: hook_user_presave-d7-1483664-14.patch queued for re-testing.
Comment #21
nmudgal CreditAttribution: nmudgal commentedCouldn't understand why it failed ?
Comment #22
boombatower CreditAttribution: boombatower commentedSeems unrelated and I don't know why someone would be using hook documentation in a test.
Comment #23
jhodgdonPlease leave this at 8.x until 8.x is done -- read http://drupal.org/node/1488414#comment-5748422
Comment #24
jhodgdonPatch in #15 is RTBC for 8.x.
Comment #25
jhodgdonThe patch in #15 has been committed to Drupal 8. Can we have a patch for Drupal 7 that puts the same code/doc in there too? The patch above for D7 is missing some of the comments.
Comment #26
nmudgal CreditAttribution: nmudgal commentedCouldn't find anything missing. I think D7 has same comment.
Comment #27
nmudgal CreditAttribution: nmudgal commentedAttached for D7.
Comment #28
jhodgdonOh sorry, I got confused with all the patches up there. :)
Committed patch in #17 to 7.x.
Comment #29
nmudgal CreditAttribution: nmudgal commentedThanks :-)
Comment #30.0
(not verified) CreditAttribution: commentedadding code sample