Subject: | Google::Adwords::KeywordToolService unable to handle result set with only one keyword |
The following is a patch against the latest version of Google::Adwords::KeywordToolService to stop the error "Not
an ARRAY reference" when the result set provided only has one keyword:
@@ -77,7 +77,14 @@
my @keywords;
if ( $data->{keywords} )
{
- for ( @{ $data->{keywords} } )
+ my @data_keywords;
+ if (ref $data->{keywords} eq 'ARRAY') {
+ @data_keywords = @{ $data->{keywords} };
+ } else {
+ push @data_keywords, $data->{keywords};
+ }
+
+ for ( @data_keywords )
{
push @keywords,
$self->_create_object_from_hash( $_,