⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

is_unique



Nico
  • profile picture
  • Member

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