fix(import): handle bad values for location attributes

This commit is contained in:
Yassine Doghri 2023-11-06 15:06:54 +00:00
parent 6a7ef0109a
commit 642981fd35
2 changed files with 7 additions and 4 deletions

View File

@ -42,8 +42,11 @@ class Location extends Entity
$longitude = null; $longitude = null;
if ($geo !== null) { if ($geo !== null) {
$geoArray = explode(',', substr($geo, 4)); $geoArray = explode(',', substr($geo, 4));
$latitude = (float) $geoArray[0];
$longitude = (float) $geoArray[1]; if (count($geoArray) === 2) {
$latitude = (float) $geoArray[0];
$longitude = (float) $geoArray[1];
}
} }
parent::__construct([ parent::__construct([

View File

@ -9,12 +9,12 @@
"php": "^8.1", "php": "^8.1",
"adaures/ipcat-php": "^v1.0.0", "adaures/ipcat-php": "^v1.0.0",
"adaures/podcast-persons-taxonomy": "^v1.0.1", "adaures/podcast-persons-taxonomy": "^v1.0.1",
"aws/aws-sdk-php": "^3.281.12", "aws/aws-sdk-php": "^3.285.0",
"chrisjean/php-ico": "^1.0.4", "chrisjean/php-ico": "^1.0.4",
"cocur/slugify": "^4.5", "cocur/slugify": "^4.5",
"codeigniter4/framework": "v4.4.1", "codeigniter4/framework": "v4.4.1",
"codeigniter4/settings": "v2.1.2", "codeigniter4/settings": "v2.1.2",
"codeigniter4/shield": "v1.0.0-beta.6", "codeigniter4/shield": "v1.0.0-beta.7",
"codeigniter4/tasks": "dev-develop", "codeigniter4/tasks": "dev-develop",
"geoip2/geoip2": "v2.13.0", "geoip2/geoip2": "v2.13.0",
"james-heinrich/getid3": "^2.0.0-beta5", "james-heinrich/getid3": "^2.0.0-beta5",