Jump to content


is_unique

rules callback is_unique

  • Please log in to reply
No replies to this topic

#1 Nico

Nico

    Member

  • Members
  • PipPip
  • 11 posts
  • LocationQuebec, Canada

Posted 08 August 2012 - 01:47 AM

Hi,

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
-- Nico --





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