Skip Menu |

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

Report information
The Basics
Id: 75785
Status: open
Priority: 0/
Queue: WWW-Mailchimp

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

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



Subject: mergevars and groupings
Can't add groupings with listSubscribe. When adding group info using listSubscribe, merge_vars must contain an array of arrays (eg merge_vars => [ GROUPINGS => [ name => 'fruits', groups => ['apples', 'bananas'] ] ]), this may be the problem.
I modified _build_query_args as below, which fixed my particular issue, but may have introduced other bugs. sub _build_query_args { my ($self, %args) = @_; my %merge_vars = @{delete $args{merge_vars} || []}; for my $var (keys %merge_vars) { if (ref($merge_vars{$var}) eq 'ARRAY') { my $count = 0; for my $val (@{$merge_vars{$var}}) { if (ref($val) eq 'ARRAY') { for my $index (0..scalar @{$val}) { $args{"merge_vars[$var][$count][$val->[$index]]"} = $val-> [$index + 1] if defined($val->[$index]) and defined($val->[$index + 1]); $index += 2; } } else { $args{"merge_vars[$var][$count]"} = $val; $count++; } } } else { $args{"merge_vars[$var]"} = $merge_vars{$var}; } }