mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 18:25:00 -06:00
A temporary fix for the problem that storing a transaction journal doesn't return the actual journal when successful.
This commit is contained in:
parent
d5bcf5497f
commit
1fbdb3d0ae
@ -268,7 +268,10 @@ class TransactionController extends BaseController
|
||||
/*
|
||||
* Try to store:
|
||||
*/
|
||||
$messageBag = $this->_helper->store($data);
|
||||
$data['return_journal'] = true;
|
||||
$set = $this->_helper->store($data);
|
||||
$journal = $set['journal'];
|
||||
$messageBag = $set['messagebag'];
|
||||
|
||||
/*
|
||||
* Failure!
|
||||
@ -283,6 +286,13 @@ class TransactionController extends BaseController
|
||||
*/
|
||||
Session::flash('success', 'Transaction "' . e(Input::get('description')) . '" saved!');
|
||||
|
||||
/*
|
||||
* Trigger something that will search for possibly matching recurring transactions.
|
||||
* This only works for expenses. However, at this point we have no idea what the latest
|
||||
* transaction is. We'll have to find it, and when the user creates a lot of them it might
|
||||
* get lost somewhere.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Redirect to original location or back to the form.
|
||||
*/
|
||||
|
@ -469,7 +469,7 @@ class Transaction implements TransactionInterface
|
||||
$journal->completed = true;
|
||||
$journal->save();
|
||||
if (isset($data['return_journal']) && $data['return_journal'] == true) {
|
||||
return $journal;
|
||||
return ['journal' => $journal, 'messagebag' => $journal->errors()];
|
||||
}
|
||||
return $journal->errors();
|
||||
}
|
||||
|
@ -106,7 +106,8 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito
|
||||
'what' => 'transfer',
|
||||
'return_journal' => true
|
||||
];
|
||||
$journal = $transactions->store($set);
|
||||
$returnSet = $transactions->store($set);
|
||||
$journal = $returnSet['journal'];
|
||||
|
||||
/*
|
||||
* Validate the store action:
|
||||
@ -333,7 +334,8 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito
|
||||
/*
|
||||
* Import it:
|
||||
*/
|
||||
$journal = $transactions->store($set);
|
||||
$returnSet = $transactions->store($set);
|
||||
$journal = $returnSet['journal'];
|
||||
|
||||
/*
|
||||
* Validate the store action:
|
||||
|
Loading…
Reference in New Issue
Block a user