mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Some last minute fixes.
This commit is contained in:
@@ -28,6 +28,7 @@ use FireflyIII\Factory\TagFactory;
|
||||
use FireflyIII\Factory\TransactionJournalMetaFactory;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Trait JournalServiceTrait
|
||||
@@ -89,14 +90,20 @@ trait JournalServiceTrait
|
||||
*/
|
||||
protected function storeMeta(TransactionJournal $journal, array $data, string $field): void
|
||||
{
|
||||
|
||||
if (!isset($data[$field])) {
|
||||
Log::debug(sprintf('Want to store meta-field "%s", but no value.', $field));
|
||||
|
||||
return;
|
||||
}
|
||||
$set = [
|
||||
'journal' => $journal,
|
||||
'name' => $field,
|
||||
'data' => $data[$field],
|
||||
'data' => (string)$data[$field],
|
||||
];
|
||||
|
||||
Log::debug(sprintf('Going to store meta-field "%s", with value "%s".', $field, (string)$data[$field]));
|
||||
|
||||
/** @var TransactionJournalMetaFactory $factory */
|
||||
$factory = app(TransactionJournalMetaFactory::class);
|
||||
$factory->updateOrCreate($set);
|
||||
|
||||
Reference in New Issue
Block a user