These errors can happen for a few reasons, but they always happen for server-side tables (MySQL, manual, or imported tables).
Check if you have any errors, notices, warnings in your console. If there are, resolve them first because they are interrupting wpDataTables' admin-ajax calls and the errors returned are referring to either bad Ajax or bad JSON response.
Another thing that could be causing this is cache. If the data is being cached on the page, the returned data is not the same, or not at least what wpDataTables is expecting to see, so the error occurs. Try clearing all cache from your website and browser, and then prevent the pages containing wpDataTables from being cached.
Last, it could be the data in the table(s) - if the data is not the type that it should be (for example, a non-numerical value in an integer or a float column), or if the data has been changed for a formula column. Try creating a new table from the source table and see if it's going to cause errors. If it doesn't (after excluding cache as the cause), look for differences between data, filters, etc.
Thank you, Alexandar, for your quick response. I have found what causes the problem, but I do not know how to fix it. Currently, I am pulling information from one table. The table has many fields, but currently I am only displaying 11 fields. I have set up six of the fields by going to the Data tab and selecting "Use values from another wpDataTable (Foreign key)" from the "Possible values for column" drop-down menu. It filters properly.
However, when I have around 6 or more fields that use use values from other wpDataTable tables, the "clear filters" button often throws up an error. Six of the fields reference data from other tables for lookup purposes. Three of those fields share the same identical foreign key lookups, and the other three share an identical foreign key lookup.
I have created a sample webpage. The three fields for last names share the same foreign key lookup and the three fields used for location share the same foreign key lookup. Click the clear filters a few times, and it should throw up an error message.
The problem never seems to appear on filtering or table loading. It only occurs when clearing the filters. If it would help, I can show you a video recording from my desktop.
I have turned off caching and have cleared the cache on the browser, but it makes no difference. I think there are too many simultaneous calls to the database, but I don't know for sure.
You said in your reply, "Check if you have any errors, notices, warnings in your console." I do not know how to do that. I tried to find any log files, but nothing showed me any problems.
I can't replicate the issue. I selected all filters available, and then only some, and each time I used the "Clear Filters" button, but it worked every time.
Can you please prevent caching for this page, delete cache from your website and your browser and test again? I forwarded the issue to one of our developers, to see if he can replicate it, but I doubt he'll be able to.
Please see the video at the link below. It will show you how to replicate the video. The table has three fields linked to a field in a table (foreign data key) and three other fields linked to another table (foreign data key). I have tried this from another computer connected to a different network, and the problem still occurs.
We can see you have an outdated version of wpDataTables installed, please update the plugin to its latest version and clear your website and browser cache. Let us know if you have the same issue after that.
Can you please provide us with a temporary wp-admin user (administrator), and turn on WP_DEBUG, so we can see what's being returned in the response.
You probably have foreign keys set for columns, so maybe somewhere the string is saved instead of the integer, and the query breaks, but we can't say that for sure without the debugging mode. If you can't provide us with wp-admin access, can you clone your website?
If yes - I'll ask you to install the Duplicator plugin. It will generate a couple of files that you can send me (along with the log-in credentials), and then I can create an exact copy of your website, see what the issue is and try to resolve it.
Please note that the files will be too large to attach to the ticket, so you can upload them via wetransfer.com and just send me the link.
If you have a large site, you may also use "wp migration" plugin, since (unlike Duplicator) it doesn't have any size limits.
When you provide us with either remote access, or duplicator files, make sure to enable the PRIVATE response, because this is a public ticket.
Thank you again, Alexsandar, for your quick reply. I am now trying the table on a website that has the latest version of WPDataTables installed. I notice that that the Clear Filters button does take longer on the more recent version, but it does not produce an error message. I will continue to work with it. If I am able to "break" it, I'll let you know. However, I think the issue may have been resolved in a version upgrade.
I can filter my table. However, when I click on "Clear Filters", I get the following error:
DataTables warning: table id=table_1 - Ajax error. For more information about this error, please see http://datatables.net/tn/7
If I make the table not editable by de-selecting the "Enable server-side processing" checkbox, I do not receive the error when clearing the filter.
Hello Tim
These errors can happen for a few reasons, but they always happen for server-side tables (MySQL, manual, or imported tables).
Check if you have any errors, notices, warnings in your console. If there are, resolve them first because they are interrupting wpDataTables' admin-ajax calls and the errors returned are referring to either bad Ajax or bad JSON response.
Another thing that could be causing this is cache. If the data is being cached on the page, the returned data is not the same, or not at least what wpDataTables is expecting to see, so the error occurs. Try clearing all cache from your website and browser, and then prevent the pages containing wpDataTables from being cached.
Last, it could be the data in the table(s) - if the data is not the type that it should be (for example, a non-numerical value in an integer or a float column), or if the data has been changed for a formula column. Try creating a new table from the source table and see if it's going to cause errors. If it doesn't (after excluding cache as the cause), look for differences between data, filters, etc.
I hope that helps.
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
Thank you, Alexandar, for your quick response. I have found what causes the problem, but I do not know how to fix it. Currently, I am pulling information from one table. The table has many fields, but currently I am only displaying 11 fields. I have set up six of the fields by going to the Data tab and selecting "Use values from another wpDataTable (Foreign key)" from the "Possible values for column" drop-down menu. It filters properly.
However, when I have around 6 or more fields that use use values from other wpDataTable tables, the "clear filters" button often throws up an error. Six of the fields reference data from other tables for lookup purposes. Three of those fields share the same identical foreign key lookups, and the other three share an identical foreign key lookup.
I have created a sample webpage. The three fields for last names share the same foreign key lookup and the three fields used for location share the same foreign key lookup. Click the clear filters a few times, and it should throw up an error message.
https://gerberfamily.org/wp/130-2/
The problem never seems to appear on filtering or table loading. It only occurs when clearing the filters. If it would help, I can show you a video recording from my desktop.
I have turned off caching and have cleared the cache on the browser, but it makes no difference. I think there are too many simultaneous calls to the database, but I don't know for sure.
You said in your reply, "Check if you have any errors, notices, warnings in your console." I do not know how to do that. I tried to find any log files, but nothing showed me any problems.
Hey Tim
I can't replicate the issue. I selected all filters available, and then only some, and each time I used the "Clear Filters" button, but it worked every time.
Can you please prevent caching for this page, delete cache from your website and your browser and test again? I forwarded the issue to one of our developers, to see if he can replicate it, but I doubt he'll be able to.
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
Please see the video at the link below. It will show you how to replicate the video. The table has three fields linked to a field in a table (foreign data key) and three other fields linked to another table (foreign data key). I have tried this from another computer connected to a different network, and the problem still occurs.
Hi Tim
We can see you have an outdated version of wpDataTables installed, please update the plugin to its latest version and clear your website and browser cache. Let us know if you have the same issue after that.
Hi again Tim.
Can you please provide us with a temporary wp-admin user (administrator), and turn on WP_DEBUG, so we can see what's being returned in the response.
You probably have foreign keys set for columns, so maybe somewhere the string is saved instead of the integer, and the query breaks, but we can't say that for sure without the debugging mode. If you can't provide us with wp-admin access, can you clone your website?
If yes - I'll ask you to install the Duplicator plugin. It will generate a couple of files that you can send me (along with the log-in credentials), and then I can create an exact copy of your website, see what the issue is and try to resolve it.
Please note that the files will be too large to attach to the ticket, so you can upload them via wetransfer.com and just send me the link.
If you have a large site, you may also use "wp migration" plugin, since (unlike Duplicator) it doesn't have any size limits.
When you provide us with either remote access, or duplicator files, make sure to enable the PRIVATE response, because this is a public ticket.
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
Thank you again, Alexsandar, for your quick reply. I am now trying the table on a website that has the latest version of WPDataTables installed. I notice that that the Clear Filters button does take longer on the more recent version, but it does not produce an error message. I will continue to work with it. If I am able to "break" it, I'll let you know. However, I think the issue may have been resolved in a version upgrade.
I'm glad to hear that Tim.
Thanks for letting me know.
If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.
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