From dd718387ede012de798140bd358f02f4923c78ec Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 8 Feb 2015 20:04:36 +0200 Subject: [PATCH 1/2] Fixed issue with production database config not being used --- app/controllers/AppController.php | 6 +++--- app/ninja/repositories/InvoiceRepository.php | 5 ++++- bootstrap/environment.default.php | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/AppController.php b/app/controllers/AppController.php index 15dd80d671b3..3f887089d9d5 100644 --- a/app/controllers/AppController.php +++ b/app/controllers/AppController.php @@ -59,19 +59,19 @@ class AppController extends BaseController return Redirect::to('/setup')->withInput(); } - $content = " $app, 'database' => $database, 'mail' => $mail] as $key => $config) { $content = 'balance = $invoice->amount; // if the invoice prefix is diff than quote prefix, use the same number for the invoice - if (($account->invoice_number_prefix || $account->quote_number_prefix) && $account->invoice_number_prefix != $account->quote_number_prefix) { + if (($account->invoice_number_prefix || $account->quote_number_prefix) + && $account->invoice_number_prefix != $account->quote_number_prefix + && $account->share_counter) { + $invoiceNumber = $invoice->invoice_number; if (strpos($invoiceNumber, $account->quote_number_prefix) === 0) { $invoiceNumber = substr($invoiceNumber, strlen($account->quote_number_prefix)); diff --git a/bootstrap/environment.default.php b/bootstrap/environment.default.php index 60409212e89a..c12ddd0b5998 100755 --- a/bootstrap/environment.default.php +++ b/bootstrap/environment.default.php @@ -1,4 +1,4 @@ Date: Sun, 8 Feb 2015 22:28:51 +0200 Subject: [PATCH 2/2] Fixed issue with production database config not being used --- app/controllers/AppController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/AppController.php b/app/controllers/AppController.php index 3f887089d9d5..a7f02ab4bff0 100644 --- a/app/controllers/AppController.php +++ b/app/controllers/AppController.php @@ -40,7 +40,7 @@ class AppController extends BaseController $database = Input::get('database'); $dbType = $database['default']; - $database[$dbType] = $database['type']; + $database['connections'] = [$dbType => $database['type']]; unset($database['type']); $mail = Input::get('mail'); @@ -103,7 +103,7 @@ class AppController extends BaseController Config::set('database.default', $dbType); - foreach ($database[$dbType] as $key => $val) { + foreach ($database['connections'][$dbType] as $key => $val) { Config::set("database.connections.{$dbType}.{$key}", $val); }