• Resolved danniee

    (@danniee)


    Hi,

    I use filters to display tables/rows. If there is no match for the filter and table is empty, a php error is displayed in my header as such:

    Warning: count(): Parameter must be an array or an object that implements Countable in /home/www/mysite.com/public_html/wp-content/plugins/tablepress/classes/class-evaluate.php on line 73

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Can you explain what filters you mean here? What Shortcode are you using?

    Regards,
    Tobias

    Thread Starter danniee

    (@danniee)

    Hi,

    By filter, I mean I have a hidden column where I add “keywords”. Then I use the filter function in tablepress to only display rows that have that keyword.

    A shortcode can look like this:

    [table id=62 filter=”redjackets” hide_columns=”5″ /]

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ok, I see. Thanks the letting me know! I’ll have to add some protection against such errors here.

    In the meantime, I can only suggest to only use filters that return at least one row… Sorry.

    Regards,
    Tobias

    Thread Starter danniee

    (@danniee)

    Ok, no problem. I’ll just keep an eye out for an update then. Thanks for all the great work with your amazing plugin @tobiasbg

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    sure, no problem!

    Best wishes,
    Tobias

    Any update on this? This would be really nice to not through a php error. We have a list of product ID’s we are running this against in another table to display nutritional facts per product. For products with no nutritional information, we do not have an ID in our table. It would be nice if the table just returned no rows instead of an error. Thanks!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi zesgar,

    no, sorry, I don’t yet have a solution for this, as I was very busy the last months. If someone wants to step up and offer help, I’d really appreciate it!

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error when table is empty’ is closed to new replies.