Re: [Mojolicious] Re: $ ->has_error validation method in Mojolicious higher than 8.33 version

2020-04-15 Thread Ivan Kolisnyk
Thank you Sebastian.
All works now.
I did not pay attention to the combination of 'required' method and filters.
середа, 15 квітня 2020 р. 00:48:40 UTC+3 користувач Sebastian Riedel 
написав:
>
> > The same code is used in the example of blog included in Mojo::Pg 
> module. 
> > Method has_error is not working in this example too with 8.36 
> Mojolicious version. 
> > The feedback of $v->has_error cannot be used for creating alert message 
> about empty field in a web form. 
> > Can you fix it so it worked like in previous versions? 
>
> Thanks, fixed. 
>
> 
> https://github.com/mojolicious/mojo-pg/compare/e44efd108841...7a4a016fd69d 
> -- 
> Sebastian Riedel 
> https://mojolicious.org 
> https://github.com/kraih 
> https://twitter.com/kraih 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/f108c1be-ab68-4c91-ae1f-618a71683d53%40googlegroups.com.


Re: [Mojolicious] Re: $ ->has_error validation method in Mojolicious higher than 8.33 version

2020-04-14 Thread Sebastian Riedel
> The same code is used in the example of blog included in Mojo::Pg module.
> Method has_error is not working in this example too with 8.36 Mojolicious 
> version.
> The feedback of $v->has_error cannot be used for creating alert message about 
> empty field in a web form.
> Can you fix it so it worked like in previous versions?

Thanks, fixed.

https://github.com/mojolicious/mojo-pg/compare/e44efd108841...7a4a016fd69d
-- 
Sebastian Riedel
https://mojolicious.org
https://github.com/kraih
https://twitter.com/kraih

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CANn9nhH8mfBG6OxKZCd-sbLv%3Dz9p_vT9uCKNeuooTWtm7CCB4Q%40mail.gmail.com.


Re: [Mojolicious] Re: $ ->has_error validation method in Mojolicious higher than 8.33 version

2020-04-12 Thread Stefan Adams
The conversation in the PR 
might provide some insight to Sebastian's pointer.  The change
 was made in 8.35.

On Sun, Apr 12, 2020 at 7:55 AM Ivan Kolisnyk  wrote:

> This is the code I use in my project:
>
> In helper:
> $app->helper(_validation => sub { my($c, $required_fields) = @_;
> my $v = $c->validation;
> foreach my $item($required_fields
> ->@*){
> $v->required($item);
> }
> return $v;
>  });
>
> and in controller:
> my $v = $app->_validation($ref_required_fields);
> if( $v->has_error ) { sub{ ... } }
>
> This code works correctly in Mojolicious versions lower than 8.34. You can
> see how it works at https://dev.mojoblog.me/authentication
>
>
> неділя, 12 квітня 2020 р. 14:57:55 UTC+3 користувач Sebastian Riedel
> написав:
>>
>> I have installed last version of Mojolicious and I found that the $
>>> ->has_error validation method was working with an error.
>>> When I send data form with empty field, which must be required full, I
>>> get empty value of $v->has_error. This method worked correctly in previous
>>> version of Mojolicious (8.28 and 8.33) I used.
>>> Please explain how to fix this bug.
>>>
>>
>> Your description is very vague, so i can only guess. But you probably
>> want to use the not_empty filter on the affected field.
>>
>> https://mojolicious.org/perldoc/Mojolicious/Validator#not_empty
>>
>> --
>> sebastian
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/2514dc71-e198-4277-8d2a-a170f943dca1%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFSbta9LcrCKZ_cmqsfX8YkVPSu4KfYDEVkzr_38xUz%2Bmw%40mail.gmail.com.