mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:34:30 -04:00
Fixes for unequal array combinations when mergins CSV imports
This commit is contained in:
parent
e4bddeaa22
commit
a24f58d3d8
@ -1 +1 @@
|
||||
5.5.76
|
||||
5.5.77
|
@ -54,6 +54,14 @@ class BaseImport
|
||||
|
||||
public $transformer;
|
||||
|
||||
public ?array $column_map = [];
|
||||
|
||||
public ?string $hash;
|
||||
|
||||
public ?string $import_type;
|
||||
|
||||
public ?bool $skip_header;
|
||||
|
||||
public function __construct(array $request, Company $company)
|
||||
{
|
||||
$this->company = $company;
|
||||
@ -78,6 +86,7 @@ class BaseImport
|
||||
public function getCsvData($entity_type)
|
||||
{
|
||||
$base64_encoded_csv = Cache::pull($this->hash.'-'.$entity_type);
|
||||
|
||||
if (empty($base64_encoded_csv)) {
|
||||
return null;
|
||||
}
|
||||
@ -636,6 +645,14 @@ class BaseImport
|
||||
ksort($keys);
|
||||
|
||||
$data = array_map(function ($row) use ($keys) {
|
||||
|
||||
$row_count = count($row);
|
||||
$key_count = count($keys);
|
||||
|
||||
if($key_count > $row_count) {
|
||||
$row = array_pad($row, $key_count, ' ');
|
||||
}
|
||||
|
||||
return array_combine($keys, array_intersect_key($row, $keys));
|
||||
}, $data);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class CSVIngest implements ShouldQueue
|
||||
|
||||
public ?string $skip_header;
|
||||
|
||||
public $column_map;
|
||||
public ?array $column_map = [];
|
||||
|
||||
public array $request;
|
||||
|
||||
|
@ -14,8 +14,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => '5.5.76',
|
||||
'app_tag' => '5.5.76',
|
||||
'app_version' => '5.5.77',
|
||||
'app_tag' => '5.5.77',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
|
Loading…
x
Reference in New Issue
Block a user