Topic: bug in purchase order delete when invoking hook_db_prevoid ()

Hi,

I found a bug in delete_po($po) function

hook_db_prevoid($po, ST_PURCHORDER);

it has to be

hook_db_prevoid(ST_PURCHORDER, $po);

please correct me, if i am wrong

ANOOP
Experience is the name everyone gives to their mistakes!

2 (edited by dearmosin 09/25/2020 11:12:03 pm)

Re: bug in purchase order delete when invoking hook_db_prevoid ()

@anoopmb: I found this function in includes/hooks.inc

This database transaction hooks are for modules to invoked before transaction is voided

function hook_db_prevoid($type, $type_no)
{
    return hook_invoke_all('db_prevoid', $type, $type_no);
}

Where $type is type of transaction like ST_PURCHORDER. Which mean first parameter must be ST_PURCHORDER.

So your correct, but @joe or @apmuthu may provide more information on this.

Regards

Mohsin Mujawar
Impulse Solutions

Re: bug in purchase order delete when invoking hook_db_prevoid ()

I will have a look at this.

Joe

4 (edited by kvvaradha 09/26/2020 05:07:24 am)

Re: bug in purchase order delete when invoking hook_db_prevoid ()

@anoopmb you are right. This is a bug. @Joe fix it. By changing the parameter location.

Subscription service based on FA
HRM CRM POS batch Themes

Re: bug in purchase order delete when invoking hook_db_prevoid ()

Fixed and committed to stable repo.

/Joe

Re: bug in purchase order delete when invoking hook_db_prevoid ()

Thanks @Joe, @Varadha

I have been facing issue while creating modules related to purchase.

ANOOP
Experience is the name everyone gives to their mistakes!