You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, i've been using this plugin and I found an issue when trying to implement the isUnique rule validation from CakePHP itself. The validation rule can't find any records because the behavior filters it, as it really should, but, since the query can't find deleted records when validating, it can't assegure the unique rule for the field too.
To solve this, we can override the validation method directly from the SoftDeletableModel class:
class SoftDeletableModel extends Model
{
[...]
public functionisUnique($fields, $or = true) {
// implement logic here
}
[...]
}
I can make a PR if you think it's fine.
The text was updated successfully, but these errors were encountered:
So, i've been using this plugin and I found an issue when trying to implement the isUnique rule validation from CakePHP itself. The validation rule can't find any records because the behavior filters it, as it really should, but, since the query can't find deleted records when validating, it can't assegure the unique rule for the field too.
To solve this, we can override the validation method directly from the SoftDeletableModel class:
I can make a PR if you think it's fine.
The text was updated successfully, but these errors were encountered: