Reply To: Unable to parse ini file: config/custom.config.ini

#1967
RRowley
Participant

I just upload some fixes for 2023 version that address the error of trying to commit or rollback changes when no transaction is in process. This was primarily an update issue but could affect other actions as well.

This doesn’t address your current issue where some field is not being set properly. I’d like to see the sql command being generated on your system that gets this error. To do that I need you to turn on the debug setting when invoice items are being generated.

To do this, you need to add lines to turn debug on and then off when the database request is made. So in your SI directory, find the Inc/Claz/Invoice.php file and open it in an editor program such as notepad or notepad+. Search for the function insertItem. It should be at line 681. In this function at line 688, is a line that executes the request to insert a new invoice item. You will insert a new line before this line and one after it that will turn the database object debug option on and off. Here is what you want to make it look like:

    private static function insertItem(array $list, ?array $taxIds): int
    {
        global $pdoDb;

        try {
            $pdoDb->setFauxPost($list);
            $pdoDb->setExcludedFields("id");
$pdoDb->debugOn("Invoice::insertItem()");
            $id = $pdoDb->request("INSERT", "invoice_items");
$pdoDb->debugOff();
            self::chgInvoiceItemTax($id, $taxIds, $list['unit_price'], $list['quantity'], false);
        } catch (PdoDbException $pde) {
$pdoDb->debugOff();
            error_log("Invoice::insertItem() - Error: " . $pde->getMessage());
            throw $pde;
        }
        return $id;
    }

The change the turns the debugOn will cause the request function to output a copy of the SQL command in the error file. Notice that immediately after this command and again the catch statement, we turn the debug back off.

Now when you add an invoice item, SQL command that does this will being the error log along with other error information. Attach that log file to a response to this message and I’ll see if it lets me know what your issue is.