Posted by aigomez on October 1, 2014 at 11:45am
Hi,
I am kind of new with Drupal, so I am not sure if I am writing in the right place.
I am using Drupal 7.28 with rules 7.x-2.7.
My goal is to control if admin validation is required depending on new user's role, but I get the following error message.
Integrity constraint violation: 1062 Duplicate entry '238-5' for key 'PRIMARY': INSERT INTO {users_roles} (uid, rid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 238 [:db_insert_placeholder_1] => 5 ) en user_save() (C:\Apache24\htdocs\meetingpoint\modules\user\user.module).
I am using this rule:
"REQUIRES" : [ "rules", "rules_i18n" ],
"ON" : { "user_insert" : [] },
"IF" : [
{ "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "5" : "5" } } } }
],
"DO" : [
{ "drupal_message" : { "message" : "Done" } },
{ "user_block" : { "account" : [ "account" ] } }
Both of "Adding a new role" and defining multiple actions.work fine.
Thanks,
Ana