Compare commits

..

4 Commits

Author SHA1 Message Date
github-actions[bot]
9e4c5435f0 Merge pull request #11605 from firefly-iii/release-1769538639
🤖 Automatically merge the PR into the develop branch.
2026-01-27 19:30:49 +01:00
JC5
cdb2b91813 🤖 Auto commit for release 'develop' on 2026-01-27 2026-01-27 19:30:39 +01:00
James Cole
f4cf158d21 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop
# Conflicts:
#	app/Factory/TransactionJournalFactory.php
2026-01-27 19:25:56 +01:00
James Cole
b19f1d0353 Restore use of NullArrayObject 2026-01-27 19:25:23 +01:00
5 changed files with 21 additions and 18 deletions

View File

@@ -50,6 +50,7 @@ use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
use FireflyIII\Services\Internal\Support\JournalServiceTrait;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\Support\NullArrayObject;
use FireflyIII\User;
use FireflyIII\Validation\AccountValidator;
use Illuminate\Support\Collection;
@@ -162,7 +163,7 @@ class TransactionJournalFactory
*
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
*/
private function createJournal(array $row): ?TransactionJournal
private function createJournal(NullArrayObject $row): ?TransactionJournal
{
Log::debug('Now in TransactionJournalFactory::createJournal()');
$row['import_hash_v2'] = $this->hashArray($row);
@@ -175,11 +176,11 @@ class TransactionJournalFactory
$order = $row['order'] ?? 0;
Log::debug('Find currency or return default.');
$currency = $this->currencyRepository->findCurrency((int) $row['currency_id'] ?? 0, (string) ($row['currency_code'] ?? ''));
$currency = $this->currencyRepository->findCurrency((int) $row['currency_id'], $row['currency_code']);
Log::debug('Find foreign currency or return NULL.');
$foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'] ?? 0, $row['foreign_currency_code'] ?? '');
$bill = $this->billRepository->findBill((int) $row['bill_id'] ?? 0, $row['bill_name'] ?? '');
$foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'], $row['foreign_currency_code']);
$bill = $this->billRepository->findBill((int) $row['bill_id'], $row['bill_name']);
$billId = TransactionTypeEnum::WITHDRAWAL->value === $type->type && $bill instanceof Bill ? $bill->id : null;
$description = (string) $row['description'];
@@ -345,7 +346,7 @@ class TransactionJournalFactory
return $journal;
}
private function hashArray(array $row): string
private function hashArray(NullArrayObject $row): string
{
unset($row['import_hash_v2'], $row['original_source']);
@@ -356,7 +357,7 @@ class TransactionJournalFactory
$json = microtime();
}
$hash = hash('sha256', $json);
Log::debug(sprintf('The hash is: %s', $hash), $row);
Log::debug(sprintf('The hash is: %s', $hash), $row->getArrayCopy());
return $hash;
}
@@ -576,7 +577,7 @@ class TransactionJournalFactory
/**
* Link a piggy bank to this journal.
*/
private function storePiggyEvent(TransactionJournal $journal, array $data): void
private function storePiggyEvent(TransactionJournal $journal, NullArrayObject $data): void
{
Log::debug('Will now store piggy event.');
@@ -591,10 +592,10 @@ class TransactionJournalFactory
Log::debug('Create no piggy event');
}
private function storeMetaFields(TransactionJournal $journal, array $transaction): void
private function storeMetaFields(TransactionJournal $journal, NullArrayObject $transaction): void
{
foreach ($this->fields as $field) {
$this->storeMeta($journal, $transaction, $field);
$this->storeMeta($journal, $transaction->getArrayCopy(), $field);
}
}
@@ -614,7 +615,7 @@ class TransactionJournalFactory
$factory->updateOrCreate($set);
}
private function storeLocation(TransactionJournal $journal, array $data): void
private function storeLocation(TransactionJournal $journal, NullArrayObject $data): void
{
if (!in_array(null, [$data['longitude'], $data['latitude'], $data['zoom_level']], true)) {
$location = new Location();

View File

@@ -36,6 +36,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Rules\UniqueIban;
use FireflyIII\Support\NullArrayObject;
use Illuminate\Support\Facades\Log;
use Safe\Exceptions\JsonException;
@@ -377,7 +378,7 @@ trait JournalServiceTrait
return $amount;
}
protected function storeBudget(TransactionJournal $journal, array $data): void
protected function storeBudget(TransactionJournal $journal, NullArrayObject $data): void
{
if (TransactionTypeEnum::WITHDRAWAL->value !== $journal->transactionType->type) {
$journal->budgets()->sync([]);
@@ -395,7 +396,7 @@ trait JournalServiceTrait
$journal->budgets()->sync([]);
}
protected function storeCategory(TransactionJournal $journal, array $data): void
protected function storeCategory(TransactionJournal $journal, NullArrayObject $data): void
{
$category = $this->categoryRepository->findCategory($data['category_id'], $data['category_name']);
if (null !== $category) {

View File

@@ -48,6 +48,7 @@ use FireflyIII\Services\Internal\Support\JournalServiceTrait;
use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Steam;
use FireflyIII\Support\NullArrayObject;
use FireflyIII\Validation\AccountValidator;
use Illuminate\Support\Facades\Log;
@@ -527,7 +528,7 @@ class JournalUpdateService
if ($this->hasFields(['category_id', 'category_name'])) {
Log::debug('Will update category.');
$this->storeCategory($this->transactionJournal, $this->data);
$this->storeCategory($this->transactionJournal, new NullArrayObject($this->data));
}
}
@@ -536,7 +537,7 @@ class JournalUpdateService
// update budget
if ($this->hasFields(['budget_id', 'budget_name'])) {
Log::debug('Will update budget.');
$this->storeBudget($this->transactionJournal, $this->data);
$this->storeBudget($this->transactionJournal, new NullArrayObject($this->data));
}
// is transfer? remove budget
if (TransactionTypeEnum::TRANSFER->value === $this->transactionJournal->transactionType->type) {

View File

@@ -79,7 +79,7 @@ return [
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2026-01-27',
'build_time' => 1769534016,
'build_time' => 1769538511,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.

6
package-lock.json generated
View File

@@ -4019,9 +4019,9 @@
}
},
"node_modules/axios": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.3.tgz",
"integrity": "sha512-ERT8kdX7DZjtUm7IitEyV7InTHAF42iJuMArIiDIV5YtPanJkgw4hw5Dyg9fh0mihdWNn1GKaeIWErfe56UQ1g==",
"version": "1.13.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.4.tgz",
"integrity": "sha512-1wVkUaAO6WyaYtCkcYCOx12ZgpGf9Zif+qXa4n+oYzK558YryKqiL6UWwd5DqiH3VRW0GYhTZQ/vlgJrCoNQlg==",
"dev": true,
"license": "MIT",
"dependencies": {