Datatables error when searching or sorting specific columns

Datatables error when searching or sorting specific columns

amosangyjamosangyj Posts: 5Questions: 2Answers: 0

Hello,

I encountered this strange issue where I am unable to perform a search on my table but am able to sort only specific columns. The error that appears is Invalid argument supplied for foreach() and what is returned is {"draw":null,"recordsTotal":null,"recordsFiltered":null,"data":[]}. I have 1 entry that loads fine when I reload the page though.

I have this debug uploaded here https://debug.datatables.net/acarad

Please let me know if you need more information

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    A PHP Error was encountered
    Severity: Warning Message: Invalid argument supplied for foreach()
    Filename: Campaigns/AdminCampaigns.php
    Line Number: 41

    That error is obviously in your own PHP file. "foreach()" expects an array, but is not being supplied with one.

  • amosangyjamosangyj Posts: 5Questions: 2Answers: 0

    But the page loads fine and some columns can be sorted. When I type in the name of the item that is shown on the table and search, this error occurs

This discussion has been closed.