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.
user_save(), even when inserting a new user, does a db_delete('user_roles') "just to be safe" - this is responsible for 1 of the 13 database queries we issue when saving a new user. Since it's impossible for a user to have any roles when this code executes, there's no reason for it to be there.
The same code, with the same comment, has been in there since 4.6.
Comment | File | Size | Author |
---|---|---|---|
user_roles_no_op_delete.patch | 928 bytes | catch | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedbe gone crufty cruft
Comment #2
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.