Support » Plugin: Advanced Post List » Invalid argument supplied for foreach()

  • Resolved SeanL-Bamboo

    (@seanl-bamboo)


    I’ve recently been working on a new (to us) project, that uses the APL plugin – and we’ve run into a bit of an issue. I wanted to post here to see if anybody has run into the same (or similar) issues in the past – and if not, record the solution when it’s found.

    Hunting in the indicated class file turns up no real results as i’m not familiar with the inner workings of the plugin. If anyone could give any indications that would be very helpful.

    We’ve recently updated the plugin, and this issue seems to have started from shortly after that point – but I can’t be sure.

    I’ve attempted to hunt down the cause of this issue with no luck.

    Errors included below.

    Thanks,

    Sean

    Warning: Invalid argument supplied for foreach() in /var/www/vhosts/railwayoperators.co.uk/httpdocs/wp-content/plugins/advanced-post-list/includes/class/APLQuery.php on line 592 Warning: array_unique() expects parameter 1 to be array, null given in /var/www/vhosts/railwayoperators.co.uk/httpdocs/wp-content/plugins/advanced-post-list/includes/class/APLQuery.php on line 613 Warning: array_values() expects parameter 1 to be array, null given in /var/www/vhosts/railwayoperators.co.uk/httpdocs/wp-content/plugins/advanced-post-list/includes/class/APLQuery.php on line 613 Warning: Invalid argument supplied for foreach() in /var/www/vhosts/railwayoperators.co.uk/httpdocs/wp-content/plugins/advanced-post-list/includes/class/APLQuery.php on line 368

    https://wordpress.org/plugins/advanced-post-list/

Viewing 1 replies (of 1 total)
  • SeanL-Bamboo

    (@seanl-bamboo)

    For anybody else with these errors – I suppressed these errors by putting the offending calls in an if(is_array()){} block, after a suggestion by a colleague.

    It’s a fairly simple solution that I hadn’t considered – as i was perhaps looking a bit too deep into the issue.

    I’m still uncertain as to what brought the error about, and will be investigating time permitting. I’ll try and keep this thread updated as and when I find anything.

Viewing 1 replies (of 1 total)
  • The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.