Query bug: it’s reading $something[0] when the array is empty

5

Hi there,

i found an interesting bug: If there are no “standard” posts (post-type=post) on the site, you will see the following error message across the site:

Warning: Undefined array key 0 in /home/clients/e7149acc540458d9407de9b87ad0e91e/sites/mysite.com/wp-content/plugins/greenshiftquery/blockrender/repeater/block.php on line 277

If I add a post, the warning message disappears…

Please look into this!

Balazs

OP

Replies

Responses

  1. you have repeater on site that fetches posts

    1. Balazs Stotz Avatar
      Balazs Stotz
      Member

      Yes, that’s exactly the problem—it can’t handle it if there’s no post…

  2. we will keep notice exactly for this purpose. Without this notice, you will not be able to know that something on site use redundant database request

    1. Balazs Stotz Avatar
      Balazs Stotz
      Member

      But what if, say, I want to list the posts, and there happen to be no posts on the page at that moment?

      In this case, the user will also see an ugly warning, which is really bad.

      Wouldn’t it be handy if we could define a “No results” status, similar to the query block?

      1. will be added in next release

Post a Reply