Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
user.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2008 at 12:53 UTC
Updated:
2 Aug 2011 at 12:12 UTC
Hi,
I added submit handler to role creation form. It would be nice to have the rid of newly created role in my handler.
So that I can identify the role and play with that.
I think it is the 'user_admin_role_submit' function in file user.admin.inc that needs to be changed. I believe it should be set in $form['values']['rid'].
Additionally I think it would be nice to do the same for all other creation forms.
-- Thanks
Comments
Comment #1
preventingchaos commentedYou might be able to get the role rid in your own submit handler using the function db_last_insert_id($table, $field) function.
Comment #2
kamanashisroy commentedThanks. I was using "SELECT LAST_INSERT_ID()" :-P. Your idea is better :) .
I have found that
drupal_write_record($table, &$object, $update = array())updates the serial ids . I think using that everywhere will make things even better. Although it has an disadvantage #227809: Fatal Error Cannot use object of type stdClass as array .Comment #3
mdupontMarked as fixed as there is an easy solution.