Topic: Compatibility fix for commit on 2020-09-28

On 28th Sep 2020, @itronics made a commit that uses a combined array addressing construct valid for PHP >= 5.4 in the file gl/includes/db/gl_db_bank_accounts.inc. In order to make it's Line 347:

    $id = $row ? get_default_bank_account($row[0])['id'] : 0;

compatible with older versions of PHP like 5.3.3, etc, it should be replaced with:

    $id = 0;
    if ($a = get_default_bank_account($row[0])) {
        $id = $a['id'];
        unset ($a);
    }

Such constructs when used in javascript in FA appear valid though, but it is not so for PHP < 5.4.

This is the only one instance in FA 2.4.x of it's kind hitherto.

Refer:
https://github.com/FrontAccountingERP/FA/commit/2f3375b4493c1b1e0b17c2801298275f22f8d76e#commitcomment-44633990
https://github.com/apmuthu/frontac24/commit/ccce28d5bbdf5298ff60a6ac504747fbd177faf7#commitcomment-44634360

Re: Compatibility fix for commit on 2020-09-28

@joe: This should have been corrected before the FA 2.4.9 release as it will surely break any upgrade on systems with PHP < v5.4.

Re: Compatibility fix for commit on 2020-09-28

@joe: Fixed in my repo.

Re: Compatibility fix for commit on 2020-09-28

@Joe, This is required fix for this version. So apply this changes and update to changes log as well.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Compatibility fix for commit on 2020-09-28

Hello all,

This has been fixed, the algorithm in get_default_supplier_bank_account() is now the same as in the function get_default_customer_bank_account().

For all of you using PHP version < 5.4, you can download the fixed file and replace in /gl/includes/db/gl_db_bank_accounts.inc.

Sorry for missing this before the 2.4.9 release.

/Joe