mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for type checks
This commit is contained in:
parent
ebc498a815
commit
70c5f268ed
@ -125,7 +125,7 @@ class TypeCheck extends Command
|
||||
{
|
||||
$this->logMessage(date('Y-m-d h:i:s').' Checking Company => ' . $company->present()->name(). " " . $company->id);
|
||||
|
||||
$company->saveSettings($company->settings, $company);
|
||||
$company->saveSettings((array)$company->settings, $company);
|
||||
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ class TypeCheck extends Command
|
||||
$this->logMessage(date('Y-m-d h:i:s').' Checking all clients and companies.');
|
||||
|
||||
Client::cursor()->each( function ($client) {
|
||||
|
||||
$this->logMessage("Checking client {$client->id}");
|
||||
$entity_settings = $this->checkSettingType($client->settings);
|
||||
$entity_settings->md5 = md5(time());
|
||||
$client->settings = $entity_settings;
|
||||
@ -144,7 +144,7 @@ class TypeCheck extends Command
|
||||
});
|
||||
|
||||
Company::cursor()->each( function ($company) {
|
||||
|
||||
$this->logMessage("Checking company {$company->id}");
|
||||
$company->saveSettings($company->settings, $company);
|
||||
|
||||
});
|
||||
|
@ -63,10 +63,21 @@ trait CompanySettingsSaver
|
||||
{
|
||||
//this pass will handle any null values that are in the translations
|
||||
foreach ($settings->translations as $key => $value) {
|
||||
|
||||
if(is_array($settings->translations))
|
||||
{
|
||||
if (is_null($settings->translations[$key])) {
|
||||
$settings->translations[$key] = '';
|
||||
}
|
||||
}
|
||||
elseif(is_object($settings->translations)){
|
||||
|
||||
if (is_null($settings->translations->{$key})) {
|
||||
$settings->translations->{$key} = '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$company_settings->translations = $settings->translations;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user