Caught a nasty bug thanks to an alert Tweakers.net user. This fix will make the account-edit screen inconsistent for a select number of users. This will be detailed on the wiki.

This commit is contained in:
James Cole
2015-08-15 21:45:29 +02:00
parent 7fbd0b2ffc
commit 28c753523f
2 changed files with 13 additions and 2 deletions

View File

@@ -136,6 +136,12 @@ class TransactionController extends Controller
*/
public function edit(AccountRepositoryInterface $repository, TransactionJournal $journal)
{
// cannot edit opening balance
if ($journal->transactionType->type == 'Opening balance') {
return view('error')->with('message', 'Cannot edit this transaction. Edit the account instead!');
}
$maxFileSize = Steam::phpBytes(ini_get('upload_max_filesize'));
$maxPostSize = Steam::phpBytes(ini_get('post_max_size'));
$uploadSize = min($maxFileSize, $maxPostSize);
@@ -333,6 +339,11 @@ class TransactionController extends Controller
public function update(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att, TransactionJournal $journal)
{
// cannot edit opening balance
if ($journal->transactionType->type == 'Opening balance') {
return view('error')->with('message', 'Cannot edit this transaction. Edit the account instead!');
}
$journalData = $request->getJournalData();
$repository->update($journal, $journalData);