jlorente/yii2-activerecord-inheritance

Bug in getFirstError

haraldglaser opened this issue · 2 comments

Last line of getFirstError() should be:
return count($errors) ? $errors[0] : null;
instead of
return empty($errors[$attribute]) ? null : $errors[0];

$errors is a numeric array.

You are right. I will fix it.

I have set your code in the trait and now it works correctly. Thank you for the collaboration!