librelist archives

« back to archive

Callback errors (i18n)

Callback errors (i18n)

From:
Eduardo Huertas
Date:
2010-09-21 @ 16:12
Hello list,

When using a callback in validation, if the callback has an error, it
is returning model_name.field_name instead of the field label.
Is there a way of returning the field label instead of
model_name.field_name when throwing an error from a callback?

Thanks in advance, best regards,
Eduardo

Re: [kohana] Callback errors (i18n)

From:
Matt Button
Date:
2010-09-22 @ 11:55
Please can you pastebin a code example?

Matt

On Tue, Sep 21, 2010 at 5:12 PM, Eduardo Huertas <e.huertas@gmail.com>wrote:

> Hello list,
>
> When using a callback in validation, if the callback has an error, it
> is returning model_name.field_name instead of the field label.
> Is there a way of returning the field label instead of
> model_name.field_name when throwing an error from a callback?
>
> Thanks in advance, best regards,
> Eduardo
>

Re: [kohana] Callback errors (i18n)

From:
Eduardo Huertas
Date:
2010-09-22 @ 15:43
2010/9/22 Matt Button <matt.button@kohanaphp.com>:
> Please can you pastebin a code example?

Thank you for your interest.
I've posted a small example at http://pastebin.com/d9RusqHd

When the callback fails I was expecting to have an error code like:
Fecha "Fecha no válida"

Instead I am getting...
gallery.date Fecha no válida


Best regards.

Re: [kohana] Callback errors (i18n)

From:
Eduardo Huertas
Date:
2010-09-22 @ 23:51
2010/9/22 Eduardo Huertas <e.huertas@gmail.com>:
> 2010/9/22 Matt Button <matt.button@kohanaphp.com>:
>> Please can you pastebin a code example?
>
> Thank you for your interest.
> I've posted a small example at http://pastebin.com/d9RusqHd
>
> When the callback fails I was expecting to have an error code like:
> Fecha "Fecha no válida"

Sorry, of course I am not expecting the quotation marks
Fecha Fecha no váilda

> Instead I am getting...
> gallery.date Fecha no válida

The main issue is that I am expecting to return the label of the field
instead of model_name.field_name (Fecha instead of gallery.date)

I hope is a little easier to understand my question now

> Best regards.