mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 19:53:44 +00:00
Debug for #3897
This commit is contained in:
@@ -59,6 +59,7 @@ class TransactionGroupFactory
|
||||
*/
|
||||
public function create(array $data): TransactionGroup
|
||||
{
|
||||
Log::debug('Now in TransactionGroupFactory::create()');
|
||||
$this->journalFactory->setUser($this->user);
|
||||
$this->journalFactory->setErrorOnHash($data['error_if_duplicate_hash'] ?? false);
|
||||
try {
|
||||
|
@@ -134,6 +134,7 @@ class TransactionJournalFactory
|
||||
*/
|
||||
public function create(array $data): Collection
|
||||
{
|
||||
Log::debug('Now in TransactionJournalFactory::create()');
|
||||
// convert to special object.
|
||||
$dataObject = new NullArrayObject($data);
|
||||
|
||||
|
@@ -83,9 +83,9 @@ trait JournalServiceTrait
|
||||
* @param string $direction
|
||||
* @param array $data
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @return Account
|
||||
* @codeCoverageIgnore
|
||||
* @throws FireflyException
|
||||
*/
|
||||
protected function getAccount(string $transactionType, string $direction, array $data): Account
|
||||
{
|
||||
@@ -184,7 +184,7 @@ trait JournalServiceTrait
|
||||
*/
|
||||
protected function storeNotes(TransactionJournal $journal, ?string $notes): void
|
||||
{
|
||||
$notes = (string)$notes;
|
||||
$notes = (string) $notes;
|
||||
$note = $journal->notes()->first();
|
||||
if ('' !== $notes) {
|
||||
if (null === $note) {
|
||||
@@ -219,14 +219,17 @@ trait JournalServiceTrait
|
||||
*/
|
||||
protected function storeTags(TransactionJournal $journal, ?array $tags): void
|
||||
{
|
||||
|
||||
Log::debug('Now in storeTags()', $tags ?? []);
|
||||
$this->tagFactory->setUser($journal->user);
|
||||
$set = [];
|
||||
if (!is_array($tags)) {
|
||||
Log::debug('Tags is not an array, break.');
|
||||
return;
|
||||
}
|
||||
Log::debug('Start of loop.');
|
||||
foreach ($tags as $string) {
|
||||
$string = (string)$string;
|
||||
$string = (string) $string;
|
||||
Log::debug(sprintf('Now at tag "%s"', $string));
|
||||
if ('' !== $string) {
|
||||
$tag = $this->tagFactory->findOrCreate($string);
|
||||
if (null !== $tag) {
|
||||
@@ -234,7 +237,10 @@ trait JournalServiceTrait
|
||||
}
|
||||
}
|
||||
}
|
||||
Log::debug('End of loop.');
|
||||
Log::debug(sprintf('Total nr. of tags: %d', count($tags)), $tags);
|
||||
$journal->tags()->sync($set);
|
||||
Log::debug('Done!');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,8 +342,8 @@ trait JournalServiceTrait
|
||||
* @param array $data
|
||||
* @param string $preferredType
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function createAccount(?Account $account, array $data, string $preferredType): Account
|
||||
{
|
||||
|
Reference in New Issue
Block a user