[Bps-public-commit] cpan2rt branch, master, updated. 72c9e14e079ea0f638b72a78a20c06bef066f940

Dianne Skoll dianne at bestpractical.com
Fri Feb 26 11:05:45 EST 2021


The branch, master has been updated
       via  72c9e14e079ea0f638b72a78a20c06bef066f940 (commit)
      from  172ac7869a52f914f1ff80e609a7c8dd2e469866 (commit)

Summary of changes:
 lib/CPAN2RT.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 72c9e14e079ea0f638b72a78a20c06bef066f940
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Fri Feb 26 11:05:29 2021 -0500

    Handle differences in how MetaCPAN versions return results.

diff --git a/lib/CPAN2RT.pm b/lib/CPAN2RT.pm
index e3017dc..33e80db 100644
--- a/lib/CPAN2RT.pm
+++ b/lib/CPAN2RT.pm
@@ -330,7 +330,15 @@ sub _sync_bugtracker_cpan2rt {
 
     # Iterate the results from MetaCPAN
     while ( my $result = $scroller->next ) {
-        my $data = $result->{fields};
+
+        # Some versions of MetaCPAN::Client return the fields in
+        # {fields}.  Some in {data}.  Why the change?  No idea.
+        my $data;
+        if ($result->{fields}) {
+            $data = $result->{fields};
+        } else  {
+            $data = $result->{data};
+        }
 
         my $bugtracker = {};
 

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list