Closed (fixed)
Project:
Drupal core
Version:
4.7.x-dev
Component:
user.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2005 at 16:01 UTC
Updated:
29 Dec 2006 at 03:08 UTC
Jump to comment: Most recent file
Comments
Comment #1
breyten commented+1 on feature (I think it's always useful to have these kind of checks -- will probably save us bug reports in the future;), but -1 on the patch. It's not necessary to call db_fetch_object to just get a role id. You can change it to this:
$rid = db_result(db_query("SELECT rid FROM {role} WHERE name = '%s'", $edit['name']);
and then simply
if ($rid) {
.
.
.
Comment #2
kuba.zygmunt commentedOk, I've changed code. I hope that this code will be good enough. ;)
Comment #3
Uwe Hermann commented+1. Patch applies and works as expected.
Comment #4
dries commentedAny reason you can't use the same code twice? I like the first approach better; avoids an object being created.
Comment #5
dries commentedComment #6
Jaza commentedPatch no longer needed: uniqueness of role names is enforced in HEAD in the user_admin_role_validate() function.