1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #5573 from turbo124/v5-develop

Fixes for namespaces
This commit is contained in:
David Bomba 2021-05-02 19:15:11 +10:00 committed by GitHub
commit d69a4a3645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -55,12 +55,17 @@ class StoreCompanyRequest extends Request
{ {
$input = $this->all(); $input = $this->all();
if(strlen($input['portal_domain']) > 1)
$input['portal_domain'] = str_replace("http:", "https:", $input['portal_domain']);
if (array_key_exists('google_analytics_url', $input)) { if (array_key_exists('google_analytics_url', $input)) {
$input['google_analytics_key'] = $input['google_analytics_url']; $input['google_analytics_key'] = $input['google_analytics_url'];
} }
$company_settings = CompanySettings::defaults(); $company_settings = CompanySettings::defaults();
//@todo this code doesn't make sense as we never return $company_settings anywhere
//@deprecated???
if (array_key_exists('settings', $input) && ! empty($input['settings'])) { if (array_key_exists('settings', $input) && ! empty($input['settings'])) {
foreach ($input['settings'] as $key => $value) { foreach ($input['settings'] as $key => $value) {
$company_settings->{$key} = $value; $company_settings->{$key} = $value;

View File

@ -59,7 +59,10 @@ class UpdateCompanyRequest extends Request
protected function prepareForValidation() protected function prepareForValidation()
{ {
$input = $this->all(); $input = $this->all();
// nlog($input);
if(strlen($input['portal_domain']) > 1)
$input['portal_domain'] = str_replace("http:", "https:", $input['portal_domain']);
if (array_key_exists('settings', $input)) { if (array_key_exists('settings', $input)) {
$input['settings'] = $this->filterSaveableSettings($input['settings']); $input['settings'] = $this->filterSaveableSettings($input['settings']);
} }

View File

@ -42,7 +42,7 @@ class CreateAccountActivity implements ShouldQueue
if(Ninja::isHosted()) if(Ninja::isHosted())
{ {
$nmo = new NinjaMailerObject; $nmo = new NinjaMailerObject;
$nmo->mailable = new Modules\Admin\Mail\Welcome($event->user); $nmo->mailable = new \Modules\Admin\Mail\Welcome($event->user);
$nmo->company = $event->company; $nmo->company = $event->company;
$nmo->settings = $event->company->settings; $nmo->settings = $event->company->settings;
$nmo->to_user = $event->user; $nmo->to_user = $event->user;

View File

@ -44,7 +44,7 @@ class CompanyObserver
nlog($company->getOriginal('portal_domain')); nlog($company->getOriginal('portal_domain'));
//fire event to build new custom portal domain //fire event to build new custom portal domain
Modules\Admin\Jobs\Domain\CustomDomain::dispatch($company->getOriginal('portal_domain'), $company); \Modules\Admin\Jobs\Domain\CustomDomain::dispatch($company->getOriginal('portal_domain'), $company);
} }
} }