Skip Menu |

This queue is for tickets about the REST-Google-Apps-Provisioning CPAN distribution.

Report information
The Basics
Id: 56948
Status: resolved
Priority: 0/
Queue: REST-Google-Apps-Provisioning

People
Owner: Nobody in particular
Requestors: ianrifkin [...] ianrifkin.com
Cc:
AdminCc:

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



Subject: getUserNicknames assumes multiple nicknames
Date: Mon, 26 Apr 2010 14:27:52 -0400
To: bug-REST-Google-Apps-Provisioning [...] rt.cpan.org
From: Ian Rifkin <ianrifkin [...] ianrifkin.com>
The getUserNicknames fails if the person has 0 or 1 nickname. There are probably multiple ways of handling this (including in the reading of the XML), but one way to correct the sub is to rewrite to something like the following: sub getUserNicknames { my $self = shift; my ( $arg ); %{$arg} = @_; map { $arg->{lc($_)} = $arg->{$_} } keys %{$arg}; foreach my $param ( qw/ username / ) { $arg->{$param} || croak( "Missing required '$param' argument" ); } my $url = qq(https://apps-apis.google.com/a/feeds/$self- Show quoted text
>{'domain'}/nickname/2.0?username=$arg->{'username'});
my $result = $self->_request( 'method' => 'GET', 'url' => $url ) || return( 0 ); my ( $ref, $nickname ); $nickname = $result->{'entry'}->{'apps:nickname'}->{'name'}; if ( $nickname ) { $ref->{$nickname} = { $result->{'entry'}->{'apps:login'}, $result->{'entry'}->{'apps:nickname'} }; return( $ref ); } else { foreach ( keys %{$result->{'entry'}} ) { $nickname = $1 if /^.*\/(.+)$/; next unless $nickname; next if $ref->{$nickname}; $ref->{$nickname} = { %{$result->{'entry'}->{$_}->{'apps:login'}}, %{$result->{'entry'}->{$_}->{'apps:nickname'}} }; } } return( $ref ); }
Resolved in 1.1.9.