All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

PHP warning: low_select_entries/vt.low_select_entries.php, Invalid argument supplied for foreach()

Tim Kelty 12 Jan 2012 23:27 problem, complete

Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: low_select_entries/vt.low_select_entries.php
Line Number: 258

It would seem this->EE->api_channel_categories can also return FALSE in some cases, causing this warning

Replies

  1. Low 13 Jan 2012 08:48

    Hi Tim,

    Thanks for reporting. You can replace that code block (the foreach loop) with this:

    if ($tree = $this->EE->api_channel_categories->category_tree($group_id)) 
    {
    foreach ($tree AS $cat)
    {
    $indent = ($cat[5] > 1) ? str_repeat(NBS.NBS, $cat[5]) : '';
    $select[$cat[0]] = $indent.$cat[1];
    }
    }


    ...which I'll add to the core.

  2. Low 20 Jan 2012 11:26

    v2.0.2 should fix this issue.