Sometimes Website import is not working. Exception in GCUtils.pm

Bug #1185931 reported by André
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GCstar
Fix Released
Medium
Kerenoc

Bug Description

Sometimes when importing Informations from the Web, after confirmation, nothing gets imported but an exception is shown in the console. I tried to get Information from "The Movie DB (DE)" for the Entry "Alvin und die Chipmunks 2":

Can't use string ("United States of America") as an ARRAY ref while "strict refs" in use at /usr/bin/../share/gcstar/lib/GCUtils.pm line 206

I'm using Version 1.7.0 from the PPA.

It looks like the array handling in the file is sometimes incorrect. I tried to debug it with this line right before the "if (ref($value)..."

print Dumper($value);

It then prints:

$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [];
$VAR1 = [
          'United States of America'
        ];
$VAR1 = [
          [
            'Animation'
          ],
          [
            "Kom\x{f6}die"
          ],
          [
            'Familie'
          ]
        ];

It looks like it expects that the string 'United States of America' ist not in an array. For the moment i fixed it with this code:

foreach (@{$value})
{
    if (ref($_) eq 'ARRAY') {
        $string .= $_->[0] . ', ';
    } else {
        $string .= $_ . ', ';
    }
}

But i don't know what the real cause is.

Revision history for this message
Kerenoc (kerenoc01) wrote :

Fixed in newer versions

Changed in gcstar:
status: New → Fix Released
assignee: nobody → Kerenoc (kerenoc01)
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.