Include safe methods and require the correct package.

This commit is contained in:
James Cole
2025-05-11 14:19:07 +02:00
parent 4af2aadc48
commit 9a02739251
61 changed files with 295 additions and 294 deletions

View File

@@ -260,7 +260,7 @@ trait JournalServiceTrait
if (null === $account) {
// final attempt, create it.
if (AccountTypeEnum::ASSET->value === $preferredType) {
throw new FireflyException(sprintf('TransactionFactory: Cannot create asset account with these values: %s', json_encode($data)));
throw new FireflyException(sprintf('TransactionFactory: Cannot create asset account with these values: %s', \Safe\json_encode($data)));
}
// fix name of account if only IBAN is given:
if ('' === (string) $data['name'] && '' !== (string) $data['iban']) {

View File

@@ -307,9 +307,9 @@ trait RecurringTransactionTrait
/** @var null|RecurrenceMeta $entry */
$entry = $transaction->recurrenceTransactionMeta()->where('name', 'tags')->first();
if (null === $entry) {
$entry = RecurrenceTransactionMeta::create(['rt_id' => $transaction->id, 'name' => 'tags', 'value' => json_encode($tags)]);
$entry = RecurrenceTransactionMeta::create(['rt_id' => $transaction->id, 'name' => 'tags', 'value' => \Safe\json_encode($tags)]);
}
$entry->value = json_encode($tags);
$entry->value = \Safe\json_encode($tags);
$entry->save();
}
if (0 === count($tags)) {