Subject: | RetrieveAllRecipients only fetchs first page |
Date: | Tue, 24 Nov 2009 15:38:36 -0800 |
To: | bug-VUser-Google-ProvisioningAPI [...] rt.cpan.org |
From: | James Miller <jmiller [...] iparadigms.com> |
Greetings,
In the source for VUser-Google-ProvisioningAPI-0.24, in the file
VUser/Google/ProvisioningAPI/V2.0.pm, in the subroutine
RetrieveAllRecipients, the code to handle the paginated response from google
does not work. It cycles through each link, if the 'rel' attribute is
'next', then it says there is another page, if it is something else, then it
marks that the last page has been reached. However, the response usually has
several links, not just the 'next' link, so unless google were to provide
the 'next' link after the 'self' and various schema links (which in my
experience, it does not) the $last_page variable will always get set.
This fixes it.
--- V2_0.pm.orig 2009-08-24 17:38:15.000000000 -0700
+++ V2_0.pm 2009-11-24 15:34:53.727706961 -0800
@@ -1374,13 +1374,12 @@
return undef;
}
+ $last_page = 1;
foreach my $link (@{ $self->{result}{'link'} }) {
if ($link->{'rel'} eq 'next') {
$url = $link->{'href'};
$last_page = 0;
- } else {
- $last_page = 1;
- }
+ }
}
}