[Solar-talk] Working with hashes (MD5) and column updates
Antti Holvikari
anttih at gmail.com
Thu Jan 3 11:43:37 CST 2008
On Jan 3, 2008 6:14 PM, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
> On Jan 3, 2008 2:06 PM, Raymond Kolbe wrote:
> > Oh, I just remembered why I created sanitizeMD5. If you use the code block
> > you posted above, it changes the password to a hash before any model
> > validation takes place.
> > [...]
> > Yes this can be put in the controller but it shouldn't be there really,
> > right?
>
> Ah, yes, indeed. But I don't know how to do differently, only adding
> logic to the controller. :-/
>
> Also, and I think this is somewhat related, I'm not sure how to mix
> model filters with non-model other filters. For example, I get a form
> from a record using $record->form(), and want to add one more field
> with its own filters... how would I do that? The model keeps the
> filters internally and we can't modify the list depending on the
> current form needs. How can we deal with this?
One option is that you just add your elements to a form object and
call "oldschool" $form->validate(). My patch[1] which allows you to
add elements to an existing Solar_Form instance instead of always
creating a new one in record::form() would probably help here.
Hope that helps.
[1] http://git.anttih.com/?p=solar.git;a=commitdiff;h=9ab282c9c77e7f88dc80caa5f766e682fa3246c1
--
Antti Holvikari
More information about the Solar-talk
mailing list