Skip Menu |
 

This queue is for tickets about the WWW-Automate CPAN distribution.

Report information
The Basics
Id: 1983
Status: new
Priority: 0/
Queue: WWW-Automate

People
Owner: Nobody in particular
Requestors: aaron.wigley [...] its.monash.edu.au
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.20
Fixed in: (no value)

Attachments


Subject: $agent->back() does not work
Download (untitled) / with headers
text/plain 998b
For WWW-Automate version 0.20. The back() method on $agent objects does not seem to work as expected. It alters the state of $agent->{page_stack}, but $agent is otherwise unchanged, especially the current URI and page content. This can be demonstrated with: use WWW::Automate; my $start_url = 'http://www.monash.edu.au/'; my $agent = WWW::Automate->new(); $agent->get( $start_url ); print $agent->{status} . ' ' . $agent->{uri} . "\n"; ## Page 1 $agent->follow( 2 ); print $agent->{status} . ' ' . $agent->{uri} . "\n"; ## Page 2 $agent->back(); print $agent->{status} . ' ' . $agent->{uri} . "\n"; ## Page 1 ?? Attached is a suggested patch to version 0.20 which fixes this problem. WWW::Automate::pop_page_stack() attempts to modify $self, but it should actually modify $_[0]. This also required a change from $self to $_[0] in WWW::Automate::back() as well. Perl v5.6.1. Linux localhost.localdomain 2.4.18-19.7.xsmp #1 SMP Thu Dec 12 07:56:58 EST 2002 i686 unknown
Download automate-patch.diff
text/x-diff 529b
291,292c291,293 < my $self = shift; < $self->pop_page_stack; --- > ## don't modify @_ here (using shift), as pop_page_stack needs to modify > ## $_[0] so that the object is updated properly with its earlier clone. > $_[0]->pop_page_stack; 365,368c366,368 < my $self = shift; < if (@{$self->{page_stack}}) { < $self = pop @{$self->{page_stack}}; < bless $self; --- > if (@{$_[0]->{page_stack}}) { > $_[0] = pop @{$_[0]->{page_stack}}; > bless $_[0];
From: aaron.wigley [...] its.monash.edu.au
Download (untitled) / with headers
text/plain 117b
[guest - Thu Jan 23 21:57:29 2003]: Show quoted text
> For WWW-Automate version 0.20.
This looks like it's fixed in WWW::Mechanize.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.