Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recurring transactions export uses repeat_until for latest_date #3264

Closed
emam0 opened this issue Apr 14, 2020 · 2 comments
Closed

Recurring transactions export uses repeat_until for latest_date #3264

emam0 opened this issue Apr 14, 2020 · 2 comments
Labels
bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release).

Comments

@emam0
Copy link

emam0 commented Apr 14, 2020

Bug description
I am running Firefly III version 5.2.1 (also on 5.0.5), and my problem is:

The export script for recurring transactions tries to format repeat_until instead of latest_date if latest_date exists, which will also raise an exception for calling format on a null field if repeat_until was not set.

I think this is the issue:

$recurrence->latest_date ? $recurrence->repeat_until->format('Y-m-d') : null,

Steps to reproduce

  1. Create a recurring transaction without setting a value for repeat_until
  2. Trigger the cronjob to create one or more transactions
  3. Try to export recurring transactions php artisan firefly-iii:export-data --export-recurring
  4. This error is raised:
[2020-04-14 17:59:58] local.ERROR: Call to a member function format() on null {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function format() on null at /var/www/firefly-iii/app/Support/Export/ExportDataGenerator.php:560)
[stacktrace]
#0 /var/www/firefly-iii/app/Support/Export/ExportDataGenerator.php(130): FireflyIII\\Support\\Export\\ExportDataGenerator->exportRecurring()
#1 /var/www/firefly-iii/app/Console/Commands/Export/ExportData.php(127): FireflyIII\\Support\\Export\\ExportDataGenerator->export()
#2 [internal function]: FireflyIII\\Console\\Commands\\Export\\ExportData->handle()
#3 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#4 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#5 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#6 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#7 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#8 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\\Container\\Container->call(Array)
#9 /var/www/firefly-iii/vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#10 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#11 /var/www/firefly-iii/vendor/symfony/console/Application.php(1001): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#12 /var/www/firefly-iii/vendor/symfony/console/Application.php(271): Symfony\\Component\\Console\\Application->doRunCommand(Object(FireflyIII\\Console\\Commands\\Export\\ExportData), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#13 /var/www/firefly-iii/vendor/symfony/console/Application.php(147): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#14 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#15 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#16 /var/www/firefly-iii/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#17 {main}
"} 

In ExportDataGenerator.php line 560:
                                                           
  [Symfony\Component\Debug\Exception\FatalThrowableError]  
  Call to a member function format() on null               
                                                           

Exception trace:
  at /var/www/firefly-iii/app/Support/Export/ExportDataGenerator.php:560
 FireflyIII\Support\Export\ExportDataGenerator->exportRecurring() at /var/www/firefly-iii/app/Support/Export/ExportDataGenerator.php:130
 FireflyIII\Support\Export\ExportDataGenerator->export() at /var/www/firefly-iii/app/Console/Commands/Export/ExportData.php:127
 FireflyIII\Console\Commands\Export\ExportData->handle() at n/a:n/a
 call_user_func_array() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/Util.php:36
 Illuminate\Container\Util::unwrapIfClosure() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:90
 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:34
 Illuminate\Container\BoundMethod::call() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/Container.php:590
 Illuminate\Container\Container->call() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php:134
 Illuminate\Console\Command->execute() at /var/www/firefly-iii/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php:121
 Illuminate\Console\Command->run() at /var/www/firefly-iii/vendor/symfony/console/Application.php:1001
 Symfony\Component\Console\Application->doRunCommand() at /var/www/firefly-iii/vendor/symfony/console/Application.php:271
 Symfony\Component\Console\Application->doRun() at /var/www/firefly-iii/vendor/symfony/console/Application.php:147
 Symfony\Component\Console\Application->run() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Application.php:93
 Illuminate\Console\Application->run() at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:131
 Illuminate\Foundation\Console\Kernel->handle() at /var/www/firefly-iii/artisan:37
@JC5
Copy link
Member

JC5 commented Apr 14, 2020

Nice find, I’ll pick it up.

@JC5 JC5 added the bug Verified and replicated bugs and issues. label Apr 14, 2020
@JC5 JC5 added the fixed Bugs that are fixed (in a coming release). label Apr 19, 2020
@JC5 JC5 closed this as completed in fbfd847 Apr 22, 2020
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release).
Projects
None yet
Development

No branches or pull requests

2 participants