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

  • Resolved kevp75

    (@kevp75)


    I am working on a protected staging site, and seeing this error come up once we upgrade the site to PHP 7.2

    Warning: Invalid argument supplied for foreach() in /nas/content/live/hcsstage/wp-content/plugins/advanced-post-list/includes/class/class-apl-query.php on line 446

    I have seen this in this forum before, not the same file, but same “warning”

    Any ideas when it will get fixed as PHP 5.6 and 7.0 both reach EOL at the end of this month…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Advanced Post List

    (@advancedpostlist)

    Thanks for reporting this.

    Looks like this could be fixed on the next update.

    Any ideas as to when that may be? The hit EOL in 4 days, and the hosting company is going to force the upgrade at that time… otherwise, it there anything else short of manually modifying the plugin code to correct it that could be done?

    Plugin Author Advanced Post List

    (@advancedpostlist)

    It was a fairly simple change, essentially the foreach loop was wrapped with an If-check( if ( ! empty( $query_str['tax_query'] ) ) { ). You can see the dev commit changes here, Fix PHP Error class-apl-query.php on line 446

    Releases are usually aimed for a Monday (UTC) for release dates, and it looks like this Monday (1/7/19) will be slated for release; there just some final testing and setup needed.

    Aye, but it’s never a real good idea to modify plugin code 😉

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