Form can't save data

I have two tables: one for client data and a second for supplier data. They are identical as below:

CREATE TABLE `client_info` (
	`id` INT(111) NOT NULL AUTO_INCREMENT,
	`shop_id` INT(5) NOT NULL,
	`c_type` VARCHAR(5) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`title` VARCHAR(11) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`c_name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`l_name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`currency` VARCHAR(5) NOT NULL COLLATE 'utf8mb4_general_ci',
	`company` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`email_addr` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`id_no` VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`dial_code` INT(5) NOT NULL DEFAULT '0',
	`phone_no` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_general_ci',
	`phone_no_2` VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`location` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;
=====================================

CREATE TABLE `vendor_info` (
	`id` INT(111) NOT NULL AUTO_INCREMENT,
	`shop_id` INT(5) NOT NULL,
	`v_type` VARCHAR(5) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`title` VARCHAR(11) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`v_name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`l_name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`currency` VARCHAR(5) NOT NULL COLLATE 'utf8mb4_general_ci',
	`company` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`email_addr` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`id_no` VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`dial_code` INT(5) NOT NULL DEFAULT '0',
	`phone_no` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_general_ci',
	`phone_no_2` VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`location` VARCHAR(200) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

On PHPMAKER, the field settings and table settings are identical. The only custom code on both forms are the startup script on add/copy page to load Google maps autofill for the location field(s). Their nothing else, not even a template.The client data add form (ClientInfoAdd) successfully saves data on pressing add but the vendor info add form (VendorInfoAdd) doesn’t. It simply returns me to the same form (VendorInfoAdd) with no errors.I have checked the apache php error log, maria db error log and nothing is popping up.What could be the problem???

Cannot reproduce the issue. I tested by creating a new project by using both tables above, and then tested by adding a new record for each table. Both tables are working properly for adding/saving a new record.You may try it by yourself just like I did above to prove it.

The only custom code on both forms are the startup script on add/copy page to load Google maps autofill for the location field(s). Their nothing else, not even a template.

You may check if there is any JavaScript error on the page. Press F12 → Console to check.

@mohbar, @arbeiNo error on the console.Still no error on any server logs.Recreated the table with a different name in the same project and still the same problem.In a different test project, no issue whatsoever.

Enable debug and try again, see https://www.hkvforums.com/viewtopic.php?f=18&t=49192.Enable the advanced setting Treat PHP warnings and notices as errors also.

Hi, thanks.All debug settings were already enabled.PHP.ini is also configured to show all errors warnings and notices i.e.
error_reporting = E_ALLI have also enabled confirm page but it is not getting there as well.Log on Row_Inserted event does not fire also.

You may press F12 and go to the Network panel, submit the page again, then check if the form is submitted.If no, it should be client side JavaScript error, double check the Console panel.If yes, it should be server side error, check the HTTP response from the server, read:
https://discourse.hkvstore.com/t/check-http-response/3213/1
(Keep all the debug settings on.)

Niijimasama wrote:

In a different test project, no issue whatsoever.

You may compare both the .pmp files by using WinMerge application, especially for those 2 tables, and see in which part they are differences.

Update:Still no change.

Problem is now occurring on another table.
New table:SHOP_INVENTORY vs the original table: SERVICES_PRODUCTS
No error on console, Network, X_debug (Updated ) .
On the network tab, I can see a POST action occurring and the user data being passed i.e.
{
“csrf_name”: “xxxxxxxxx”,
“csrf_value”: xxxxxxxxxx",
“t”: “shop_inventory”,
“action”: “insert”,
“modal”: “0”,
“k_oldkey”: “”,
“x_shop_id”: “5”,
“x_item_type”: “S”,
“x_item_vendor”: “9”,
“x_item_code”: “5S2”,
“x_item_desc”: “Transport”,
“x_currency”: “USD”,
“x_buy_price”: “100”,
“x_sell_price”: “250”,
“x_item_status”: “1”,
“x_uom”: “”,
“x_start_stock”: “0”,
“x_bought_stock”: “0”,
“x_available_stock”: “0”,
“x_minimum_stock”: “5”
}
Even the “insert” action is called but no insert action occurs. I can see the method in the add file defined but it is not firing.Going to try it on a different machine to see if that is the problem.

Just noticed something else:For pages that do not save, I get status 200 OK while for forms that save i get status 302 Found.Any idea what might be causing this?

If you see HTTP POST data, the problem should be on server side. Some error occurred and it prevent the data from being saved.arbei wrote:

Enable debug and try again, see
https://www.hkvforums.com/viewtopic.php?f=18&t=49192> .> Enable the advanced setting > Treat PHP warnings and notices as errors > also.

Please use the latest version (v2021.0.5 as of today) and try above again, then check the log file (under the log file folder you specify under PHP → General Options → Audit Trail tab) again for server side errors.