[Mojolicious] named route not working after upgrade from 7.33

2020-01-09 Thread 'Rolf Schaufelberger' via Mojolicious
Hi, 
 I have a route definition like this

my $order = $r->any('/order')->to(controller => 'order');
$order->get('/')->to(action => 'index');
$order->post('/find')->to(action => 'find');
$order->get('/edit/:id')->to(action => 'index');
$order->get('/edit/:id(*tab)')->to(action => 'index', title => 'Auftrag 
bearbeiten')->name('order_edit');

in Order::find I then have :
...
return $self->redirect_to('order_edit', id => $order->id) if $order;

which works fine in 7.33

After upgrading to 8.29 it doesn't work any more, instead I get 

[Mojolicious::Routes ] Routing to controller "Eller::Controller::Order" and 
action "find" [Mojolicious::Controller ] 302 Found (0.089613s, 11.159/s) 
[Mojolicious ] GET "/order/edit/243" 

Changing my routes to:

my $order = $r->any('/order')->to(controller => 'order');
$order->get('/')->to(action => 'index');
$order->post('/find')->to(action => 'find');
$order->get('/edit/:id')->to(action => 'index')*->name('order_edit');*
$order->get('/edit/:id(*tab)')->to(action => 'index', title => 'Auftrag 
bearbeiten');

again works, yet, this isn't exactly the same. 
I couldn't find any hints in the release notes, that sth. has changed for 
the routing. 

"routes -v" gives 
+/order  * order ^\/order +/  GET ^/?(?:\.([^/]+))?$ +/find  
POST find ^\/find/?(?:\.([^/]+))?$ +/edit/:id  GET editid 
^\/edit/([^/.]+)/?(?:\.([^/]+))?$ +/edit/:id(*tab)  GET "order_edit" 
^\/edit/([^/.]+)/?(?:\.([^/]+))?$

for both 7.33 and 8.29

Any idea?
Rolf

-- 
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/66b70122-cd26-4d14-8127-f4421526212b%40googlegroups.com.


Re: [Mojolicious] named route not working after upgrade from 7.33

2020-01-09 Thread Dan Book
Placeholder syntax was changed from parentheses to chevrons <> in 7.75. I
will add this to https://github.com/mojolicious/mojo/wiki/Upgrading once I
figure out when the old syntax was actually removed.

-Dan

On Thu, Jan 9, 2020 at 5:17 PM 'Rolf Schaufelberger' via Mojolicious <
mojolicious@googlegroups.com> wrote:

> Hi,
>  I have a route definition like this
>
> my $order = $r->any('/order')->to(controller => 'order');
> $order->get('/')->to(action => 'index');
> $order->post('/find')->to(action => 'find');
> $order->get('/edit/:id')->to(action => 'index');
> $order->get('/edit/:id(*tab)')->to(action => 'index', title => 'Auftrag
> bearbeiten')->name('order_edit');
>
> in Order::find I then have :
> ...
> return $self->redirect_to('order_edit', id => $order->id) if $order;
>
> which works fine in 7.33
>
> After upgrading to 8.29 it doesn't work any more, instead I get
>
> [Mojolicious::Routes ] Routing to controller "Eller::Controller::Order"
> and action "find" [Mojolicious::Controller ] 302 Found (0.089613s,
> 11.159/s) [Mojolicious ] GET "/order/edit/243"
>
> Changing my routes to:
>
> my $order = $r->any('/order')->to(controller => 'order');
> $order->get('/')->to(action => 'index');
> $order->post('/find')->to(action => 'find');
> $order->get('/edit/:id')->to(action => 'index')*->name('order_edit');*
> $order->get('/edit/:id(*tab)')->to(action => 'index', title => 'Auftrag
> bearbeiten');
>
> again works, yet, this isn't exactly the same.
> I couldn't find any hints in the release notes, that sth. has changed for
> the routing.
>
> "routes -v" gives
> +/order  * order ^\/order +/  GET ^/?(?:\.([^/]+))?$ +/find 
> POST find ^\/find/?(?:\.([^/]+))?$ +/edit/:id  GET editid
> ^\/edit/([^/.]+)/?(?:\.([^/]+))?$ +/edit/:id(*tab)  GET "order_edit"
> ^\/edit/([^/.]+)/?(?:\.([^/]+))?$
>
> for both 7.33 and 8.29
>
> Any idea?
> Rolf
>
> --
> 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/66b70122-cd26-4d14-8127-f4421526212b%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/CABMkAVVQXorrSzzbxbjNWrNFEeqE2ux0mj8_w%3DOY%3DAcoZDdYuQ%40mail.gmail.com.


Re: [Mojolicious] named route not working after upgrade from 7.33

2020-01-09 Thread Dan Book
And added:
https://github.com/mojolicious/mojo/wiki/Upgrading#upgrading-to-mojolicious-788

-Dan

On Thu, Jan 9, 2020 at 5:21 PM Dan Book  wrote:

> Placeholder syntax was changed from parentheses to chevrons <> in 7.75. I
> will add this to https://github.com/mojolicious/mojo/wiki/Upgrading once
> I figure out when the old syntax was actually removed.
>
> -Dan
>
> On Thu, Jan 9, 2020 at 5:17 PM 'Rolf Schaufelberger' via Mojolicious <
> mojolicious@googlegroups.com> wrote:
>
>> Hi,
>>  I have a route definition like this
>>
>> my $order = $r->any('/order')->to(controller => 'order');
>> $order->get('/')->to(action => 'index');
>> $order->post('/find')->to(action => 'find');
>> $order->get('/edit/:id')->to(action => 'index');
>> $order->get('/edit/:id(*tab)')->to(action => 'index', title => 'Auftrag
>> bearbeiten')->name('order_edit');
>>
>> in Order::find I then have :
>> ...
>> return $self->redirect_to('order_edit', id => $order->id) if $order;
>>
>> which works fine in 7.33
>>
>> After upgrading to 8.29 it doesn't work any more, instead I get
>>
>> [Mojolicious::Routes ] Routing to controller "Eller::Controller::Order"
>> and action "find" [Mojolicious::Controller ] 302 Found (0.089613s,
>> 11.159/s) [Mojolicious ] GET "/order/edit/243"
>>
>> Changing my routes to:
>>
>> my $order = $r->any('/order')->to(controller => 'order');
>> $order->get('/')->to(action => 'index');
>> $order->post('/find')->to(action => 'find');
>> $order->get('/edit/:id')->to(action => 'index')*->name('order_edit');*
>> $order->get('/edit/:id(*tab)')->to(action => 'index', title => 'Auftrag
>> bearbeiten');
>>
>> again works, yet, this isn't exactly the same.
>> I couldn't find any hints in the release notes, that sth. has changed for
>> the routing.
>>
>> "routes -v" gives
>> +/order  * order ^\/order +/  GET ^/?(?:\.([^/]+))?$ +/find 
>> POST find ^\/find/?(?:\.([^/]+))?$ +/edit/:id  GET editid
>> ^\/edit/([^/.]+)/?(?:\.([^/]+))?$ +/edit/:id(*tab)  GET "order_edit"
>> ^\/edit/([^/.]+)/?(?:\.([^/]+))?$
>>
>> for both 7.33 and 8.29
>>
>> Any idea?
>> Rolf
>>
>> --
>> 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/66b70122-cd26-4d14-8127-f4421526212b%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/CABMkAVWK2Uh5fSQ270JJguKCWSRQo1BfEOnHwt0ER303%2BU2fZw%40mail.gmail.com.


Re: [Mojolicious] named route not working after upgrade from 7.33

2020-01-10 Thread Francesc Guasch

On 9/1/20 23:21, Dan Book wrote:
Placeholder syntax was changed from parentheses to chevrons <> in 7.75. I will 
add this to https://github.com/mojolicious/mojo/wiki/UpgradingĀ once I figure 
out when the old syntax was actually removed.




I too stumbled upon this and I did this to keep the old behaviour:

my $routes = app->routes->children;
for my $route (@$routes){
$route->pattern->quote_start('(');
$route->pattern->quote_end(')');
$route->pattern->parse($route->pattern->unparsed);
}

--
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/bf1a2906-969b-87f6-5f92-3a19ce8eaf5e%40telecos.upc.edu.