The table is editable and users can edit existing entries, but there is an error when trying to add a new entry saying "Error! There was an error trying to add a new row".
Is this an SQL Query based table, and if it is - does it contain JOINs, UNIONs or CONCAT functions? If this is the case, unfortunately only one MySQL table can be edited at a time. Queries from multiple tables with joins cannot be used as an editable feature, since SQL UPDATE and INSERT statements are generated automatically, and there currently is no way to update multiple tables – but this problem is being investigated and pursued.
Another reason could be that the ID column for editing is not a unique, primary column. I couldn't say without taking a look at the database, though.
I saw there's a 500 - server error when trying to edit the table, and the PHP error states this:
Call to a member function format() on bool in /home/shmcurv/public_html/wp-content/plugins/wpdatatables/controllers/wdt_ajax_actions.php:307
Line 307 of that file is the date format:
So, the issue is with the predefined editing input for the "Last Updated" column:
Your date format (in wpDataTables settings) is set to d/m/Y, so d.m.Y is going to throw an error. You either need to change the Predefined value or remove it altogether. The column's input is mandatory either way, so you don't need a predefined value there.
If you take a look at the last row of the table, you'll see I was able to add the TEST row using a correct date format.
The table is editable and users can edit existing entries, but there is an error when trying to add a new entry saying "Error! There was an error trying to add a new row".
Hello Thomas
There could be a few reasons why this happens.
Is this an SQL Query based table, and if it is - does it contain JOINs, UNIONs or CONCAT functions? If this is the case, unfortunately only one MySQL table can be edited at a time. Queries from multiple tables with joins cannot be used as an editable feature, since SQL UPDATE and INSERT statements are generated automatically, and there currently is no way to update multiple tables – but this problem is being investigated and pursued.
Another reason could be that the ID column for editing is not a unique, primary column. I couldn't say without taking a look at the database, though.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Thomas
I saw there's a 500 - server error when trying to edit the table, and the PHP error states this:
Call to a member function format() on bool in /home/shmcurv/public_html/wp-content/plugins/wpdatatables/controllers/wdt_ajax_actions.php:307
Line 307 of that file is the date format:
So, the issue is with the predefined editing input for the "Last Updated" column:
Your date format (in wpDataTables settings) is set to d/m/Y, so d.m.Y is going to throw an error. You either need to change the Predefined value or remove it altogether. The column's input is mandatory either way, so you don't need a predefined value there.
If you take a look at the last row of the table, you'll see I was able to add the TEST row using a correct date format.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables