bug in the bridge?

16 views
Skip to first unread message

Oleg Zhelo

unread,
Aug 23, 2010, 12:13:13 PM8/23/10
to mojol...@googlegroups.com
Hi,
I have a code:

$auth->bridge->to('controller-album#allow') ;
$album_active->route( '/home/photoalbum/:album/edit/',
album => qr/\d+/ )->via('get')
->to('controller-photo_album#edit');

There was possibility to get $self->param('album') in
Controller::Album::allow in the older versions of Mojolicious. But in
latest github version, $self->param('album') return 'undefined' in
Controller::Album::allow.

Best regards,
Oleg Zhelo

Sebastian Riedel

unread,
Aug 23, 2010, 7:39:02 PM8/23/10
to mojol...@googlegroups.com
> There was possibility to get $self->param('album') in
> Controller::Album::allow in the older versions of Mojolicious. But in
> latest github version, $self->param('album') return 'undefined' in
> Controller::Album::allow.

The old behavior was actually the bug.

--
Sebastian Riedel
http://labs.kraih.com
http://mojolicious.org
http://twitter.com/kraih

Oleg Zhelo

unread,
Aug 24, 2010, 2:03:05 AM8/24/10
to mojol...@googlegroups.com
It was very usefull :)
Oleg Zhelo

Dotan Dimet

unread,
Aug 24, 2010, 3:54:21 AM8/24/10
to mojol...@googlegroups.com
Sebastian, you added that behavior following a feature request on the
(old, pre-googlegroups) mailing list.
http://github.com/kraih/mojo/commit/5de8c361a1f32d28566bef1e39ea27a7c43e5076
Can you explain why you decided it's a bug?


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Sebastian Riedel

unread,
Aug 24, 2010, 6:57:49 AM8/24/10
to mojol...@googlegroups.com
> Sebastian, you added that behavior following a feature request on the (old, pre-googlegroups) mailing list.
> http://github.com/kraih/mojo/commit/5de8c361a1f32d28566bef1e39ea27a7c43e5076

That commit looks entirely unrelated.

> Can you explain why you decided it's a bug?

The problem is really simple, it screws up the renderer.

$r->bridge('/foo')->to('foo#bar')->route('/baz')->to('#baz');

Take this bridge for example.

sub bar {
my $self = shift;
$self->render and return unless $self->req->headers->header('X-Bender');
}

Old broken behavior would mean 'foo/baz.html.ep' gets rendered, new fixed behavior 'foo/bar.html.ep'.

Reply all
Reply to author
Forward
0 new messages