Sometimes Website import is not working. Exception in GCUtils.pm
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/
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 = [
[
],
[
],
[
]
];
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.
Fixed in newer versions