Topic: Invalid Edit Session error and fix

When we first login to FA, there is no $_SESSION[$cartname] available.

When we then choose Sales => Direct Sales Invoice and then we change the payment terms first we get the error:
This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.

The fix is to change line 49 in sales/includes/sales_ui.inc:

    if ((!isset($SysPrefs->no_check_edit_conflicts) || $SysPrefs->no_check_edit_conflicts==0) && $cart_id && $cart_id != $_SESSION[$cartname]->cart_id) {

to

    if ((!isset($SysPrefs->no_check_edit_conflicts) || $SysPrefs->no_check_edit_conflicts==0) && $cart_id && isset($_SESSION[$cartname]) && $cart_id != $_SESSION[$cartname]->cart_id) {
Post's attachments

cart_session_patch.diff 724 b, 3 downloads since 2017-12-22 

You don't have the permssions to download the attachments of this post.

Re: Invalid Edit Session error and fix

@joe: Thanks for the commit.

Re: Invalid Edit Session error and fix

What will happen if i commented this line in sales/customer_delivery.php ->

check_edit_conflicts(get_post('cart_id'));
 else {
    // check_edit_conflicts(get_post('cart_id')); //------------------------------------------
    if (!check_quantities()) {
        display_error(_("Selected quantity cannot be less than quantity invoiced nor more than quantity    not dispatched on sales order."));
    } elseif(!check_num('ChargeFreightCost', 0)) {
        display_error(_("Freight cost cannot be less than zero"));
        set_focus('ChargeFreightCost');
    }