I have a table where I would like to allow front-end editing. Firstly when I've installed the plugin everything worked correctly but now, whenever I enable the "Allow Front End Editing" and with it the mandatory "Server-Side Processing" I get to see the following error:
DataTables warning: table id=table_1 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
I have followed the bugfix suggestions as described on the datatables.net page but don't know exactly how to fix the error.
If needed I can provide the Ajax response. Getting in there error messages on line 1794 in the class.wpdatatable.php when I execute the save button in the wp-admin backend.
Thanks for your help.
UPDATE #2:
The generated JSON code snippet is valid but I get an error in the Ajax file:
<br />
<b>Notice</b>: Undefined index: client_id in <b>/home/servername/www/domainname/wp-content/plugins/wpdatatables/source/class.wpdatatable.php</b> on line <b>1750</b><br /> <br />
<br />
<b>Notice</b>: Undefined index: client_id in <b>/home/servername/www/domainname/wp-content/plugins/wpdatatables/source/class.wpdatatable.php</b> on line <b>1753</b><br />
<br />
I get that undefined index error for every column in the table.
Thank you for your purchase, and sorry for the inconvenience.
Can you please show me the query? This error can occur if you're running a complex SQL query; if there are some security measures blocking the admin-ajax call on your website (they can be implemented by security plugins or on your server) or if the data that's being pulled is consisted of a wrong format.
The JSON is most likely being blocked, but I can't say without taking a look.
Can you please provide me a temporary wp-admin (administrator) user, and tell me what's the table ID affected here, and I'll gladly log in and take a look.
Please note that this is a public ticket, so make sure to enable the PRIVATE response.
There was a bug in wpDataTables. One of our developers remoted into your website and added the fix for this. That fix will be included in the next update, so you don't have to worry about it anymore.
The issue has been fixed on your website, that's why you can't see any issues.
Sorry for my slow reply. I have tried it multiple times from different browsers / computers but when I turn off the WP_Debug mode then the error appears again. Once WP_Debug is set on "true" everything works fine.
Can you please go to ..wp-content/plugins/wpdatatables/source/class.wpdatatable.php and replace line 1750:
if (in_array($wdtParameters['data_types'][$_POST['columns'][$i]['name']], array('date', 'datetime', 'time'))) {
with this:
if (isset($wdtParameters['data_types'][$_POST['columns'][$i]['name']]) && in_array($wdtParameters['data_types'][$_POST['columns'][$i]['name']], array('date', 'datetime', 'time'))) {
And line 1753:
if (is_null($wdtParameters['foreignKeyRule'][$_POST['columns'][$i]['name']])) {
With this:
if (isset($wdtParameters['foreignKeyRule'][$_POST['columns'][$i]['name']]) && is_null($wdtParameters['foreignKeyRule'][$_POST['columns'][$i]['name']])) {
Can you please turn off debugging, so we can try replicating the issue. We cannot see the errors you see, everything is working normally for us.
Which browser are you using? Some of the recordings showing a table on a booking site has prefixes, so can you please record the entire screen, so we can see the browser as well, which table is this happening for, so we can try on our end, and if we still can't replicate the issue, record our screens, so you see it's working fine for us?
I have a table where I would like to allow front-end editing. Firstly when I've installed the plugin everything worked correctly but now, whenever I enable the "Allow Front End Editing" and with it the mandatory "Server-Side Processing" I get to see the following error:
DataTables warning: table id=table_1 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
I have followed the bugfix suggestions as described on the datatables.net page but don't know exactly how to fix the error.
If needed I can provide the Ajax response. Getting in there error messages on line 1794 in the class.wpdatatable.php when I execute the save button in the wp-admin backend.
Thanks for your help.
UPDATE #2:
The generated JSON code snippet is valid but I get an error in the Ajax file:
<br />
<b>Notice</b>: Undefined index: client_id in <b>/home/servername/www/domainname/wp-content/plugins/wpdatatables/source/class.wpdatatable.php</b> on line <b>1750</b><br />
<br />
<br />
<b>Notice</b>: Undefined index: client_id in <b>/home/servername/www/domainname/wp-content/plugins/wpdatatables/source/class.wpdatatable.php</b> on line <b>1753</b><br /> <br />
I get that undefined index error for every column in the table.
Update: It only happens when I configure a foreign key to another table. I am fetching the tables via SQL.
Hello Raphael
Thank you for your purchase, and sorry for the inconvenience.
Can you please show me the query? This error can occur if you're running a complex SQL query; if there are some security measures blocking the admin-ajax call on your website (they can be implemented by security plugins or on your server) or if the data that's being pulled is consisted of a wrong format.
The JSON is most likely being blocked, but I can't say without taking a look.
Can you please provide me a temporary wp-admin (administrator) user, and tell me what's the table ID affected here, and I'll gladly log in and take a look.
Please note that this is a public ticket, so make sure to enable the PRIVATE response.
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
Hello again Raphael
There was a bug in wpDataTables. One of our developers remoted into your website and added the fix for this. That fix will be included in the next update, so you don't have to worry about it anymore.
The issue has been fixed on your website, that's why you can't see any issues.
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
That sounds strange, Raphael
I forwarded the ticket to our developer again, so he can take a look.
I'll get back to you as soon as I hear from him.
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
Hello again Raphael
We could not replicate the issue, but we did change the lines of code, so it should work correctly now.
Please test it and let me know.
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
Hey Aleksandar
Sorry for my slow reply. I have tried it multiple times from different browsers / computers but when I turn off the WP_Debug mode then the error appears again. Once WP_Debug is set on "true" everything works fine.
Thanks,
Raphael
Hello again Raphael
Can you please go to ..wp-content/plugins/wpdatatables/source/class.wpdatatable.php and replace line 1750:
with this:
And line 1753:
With this:
Let me know if that works.
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
Hi Aleksandar
Thank you very much for your efforts in resolving this problem. I have exchanged the two lines of code as per your suggestion.
The outcome is that:
A) the search function is not working anymore (does not show a result anymore)
B) if I turn off the debug mode the error still remains
I have changed the two lines back to the old state so that at least the search function remains working.
Thanks a lot,
Raphael
Hi again Raphael
Can you please turn off debugging, so we can try replicating the issue. We cannot see the errors you see, everything is working normally for us.
Which browser are you using? Some of the recordings showing a table on a booking site has prefixes, so can you please record the entire screen, so we can see the browser as well, which table is this happening for, so we can try on our end, and if we still can't replicate the issue, record our screens, so you see it's working fine for us?
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