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

Fatal php error in create loan schedule #30655

Closed
lippoliv opened this issue Aug 16, 2024 · 1 comment
Closed

Fatal php error in create loan schedule #30655

lippoliv opened this issue Aug 16, 2024 · 1 comment
Labels
Bug This is a bug (something does not work as expected)

Comments

@lippoliv
Copy link
Sponsor Contributor

lippoliv commented Aug 16, 2024

Bug

Creating loan schedules is failing

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, 
  null given in /var/www/html/loan/schedule.php:234 Stack trace: #0 {main} thrown in 
  /var/www/html/loan/schedule.php on line 234

Dolibarr Version

19.0.2,19.0.3,20.0.0

Environment PHP

8.2

Environment Database

mariadb:latest

Steps to reproduce the behavior and expected behavior

  1. Install dolibarr
  2. Activate bank and loan module
  3. Create a bank account
  4. Create a loan
  5. Try to create a schedule

Attached files

image image image
@lippoliv lippoliv added the Bug This is a bug (something does not work as expected) label Aug 16, 2024
lippoliv pushed a commit to lippoliv/dolibarr that referenced this issue Aug 16, 2024
also replace wrong variable `$echeance` with `$new_echeance`

Dolibarr#30655
lippoliv pushed a commit to lippoliv/dolibarr that referenced this issue Aug 16, 2024
@lippoliv lippoliv changed the title Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given Fatal php error in create loan schedule Aug 16, 2024
eldy added a commit that referenced this issue Aug 16, 2024
* don't set `$echeances->lines` to null to prevent fatal error

also replace wrong variable `$echeance` with `$new_echeance`

#30655

* replace "step1" with a more speaking error message

#30655

---------

Co-authored-by: Oliver Lippert <[email protected]>
Co-authored-by: Laurent Destailleur <[email protected]>
@lippoliv
Copy link
Sponsor Contributor Author

Closed with #30656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

1 participant