[Koha] JSON parsing problem with KOha 24.05

Coehoorn, Joel jcoehoorn at york.edu
Thu Oct 10 04:10:14 NZDT 2024


Start by examining the value of $response30->content on the both the old
and updated systems to see what is actually returned

*Joel Coehoorn*
Director of Information Technology
*York University*
Office: 402-363-5603 | jcoehoorn at york.edu | york.edu



On Tue, Oct 8, 2024 at 11:58 PM Alvaro Cornejo <cornejo.alvaro at gmail.com>
wrote:

> Hi All
>
> We are still preparing the migration from 19.11 to 24.05
>
> We are testing some parsing some reports through JSON that work in 19.11
> but does not in 24.05.
>
> The snippet where we think there is a problem is:
>
> In 19.11 this works fine. We get the values and we can do the magic we need
>
> 36 my $url30 = "https://XXX/cgi-bin/koha/svc/report?id=87";
> 37 my $request30 = HTTP::Request->new("GET" => $url30);
> 38 my $response30 = $ua->request($request30);
> 39
> 40 use JSON;
> 41 my $json_obj30 = JSON->new->utf8->decode($response30->content);
> 42
> 43 # Gives the number of rows (30 days) in the array
> 44 my $row_num30 = scalar(@{$json_obj30});
> 45 print scalar(@{$json_obj30}), " rows30\n";
>
>
> However, the same code in 24.05 give us the following error:
>
> acornejo at Koha24:~/perl$ sudo perl TablaEventos.pl
>
> Ejecutando TablaEventos-84
> malformed JSON string, neither tag, array, object, number, string or atom,
> at character offset 0 (before "Can't connect to bib...") at TablaEventos.pl
> line 41.
> acornejo at Koha24:~/perl$
>
> Line 41 correspond to:
> 41  my $json_obj30 = JSON->new->utf8->decode($response30->content);
>
> Any idea what could be wrong?
>
> Regards
>
> Alvaro
>
>
>
>
>
>
>
>
>
> |----------------------------------------------------------------------------------------|
>  Stay safe / Cuídate/  Reste sécurisé
> *7* Switch off as you go / Apaga lo que no usas /  Débranchez au fur et à
> mesure.
>  *q *Recycle always / Recicla siempre / Recyclez toujours
>  P Print only if absolutely necessary / Imprime solo si es necesario /
> Imprimez seulement si nécessaire
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list