⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. Very soon this forum will be read-only and archived. ⚠


rules callback is_unique

  • Please log in to reply
No replies to this topic

#1 Nico



  • Members
  • PipPip
  • 11 posts

Posted 08 August 2012 - 01:47 AM


I'm trying to find a way to make a rule callback rule that does the same job as "is_unique[table.field]" and that works for both Add/Edit but, if it's on edit, it checks in the database to see if the username is his...because else, if the user doesn't edit his username, the rule will launch an error...saying that the username isn't unique.

I saw in the FAQ a question close to mine but, it ended that the field was disabled on edit...which I don't want...

I there a way to get the state(Add/Edit) in the callback of a rule and maybe the primary key too????
If not, how could I do that?

Thanks in advance

Also tagged with one or more of these keywords: rules, callback, is_unique

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users