CronJob error: cronjob is not working

In Account.php line 1126:

  Unparenthesized `a ? b : c ?: d` is deprecated. Use either `(a ? b : c) ?: d` or `a ? b : (c ?:

PHP 7.4
InvoiceNinja 4.5.23


Changing to PHP 7.3 should resolve the issue

Found that PHP 7.4 is not supported (bad as there is no other stable release).
Anyway I find a fix:

Replaced line 1126 of app/models/Account.php


$currencyId = ($client && $client->currency_id) ? ($client->currency_id) : ($this->currency_id ?: DEFAULT_CURRENCY);

This resolve the cron issue but with PHP 7.4 you get other error elsewhere example when try to access or edit invoice.

Nothing to do, PHP 7.4 is not supported… and this is an issue… I need downgrade to an older version of PHP and this is not good. Migrating to V5 is not possible as my control panel never allow me to install version V5.

1 Like

PHP 7.3 is still supported, we plan to have v5 stable by the time support ends

This code change actually fixes this error. I had similar issue and even after changing PHP version to 7.3, it didn’t work. Changing this line actually helped.