Forums

Widget Logic
[resolved] Just updated to v0.50, new error line 164 (14 posts)

  1. David Tierney
    Member
    Posted 5 months ago #

    Just updated and now my site has error messages all over it that say:

    Warning: Invalid argument supplied for foreach() in /home/arjuna/public_html/wp-content/plugins/widget-logic/widget_logic.php on line 164

    http://wordpress.org/extend/plugins/widget-logic/

  2. David Tierney
    Member
    Posted 5 months ago #

    I'd give you a link but I had to disable the plugin so that I could keep working on the site. The messages were several accross the top of the page and down the sidebar where all widgets would be.

  3. alanft
    Member
    Posted 5 months ago #

    i don't suppose you'd help with some extra troubleshooting code…

    If you add

    echo "<pre>WIDGET LIST=";print_r($widget_list); echo "</pre>";

    just before line 164, then before each error you should also see text saying "WIDGET LIST=…" and it would be useful to see what that is.

    If you'd rather e-mail the results to me let me know and i'll post my gmail.

  4. David Tierney
    Member
    Posted 5 months ago #

    Looks like this:

    WIDGET LIST=Array
    (
    [0] => text-2
    [1] => rss-2
    )

    WIDGET LIST=Array
    (
    [0] => recent-comments-2
    [1] => meta-2
    )

    WIDGET LIST=Array
    (
    )

    WIDGET LIST=Array
    (
    )

    WIDGET LIST=Array
    (
    )

    WIDGET LIST=Array
    (
    )

    WIDGET LIST=Array
    (
    )

    WIDGET LIST=

  5. David Tierney
    Member
    Posted 5 months ago #

    Feel free to give me a call if you want, if that helps. Phone number here: http://designsbytierney.com/contact-david-tierney.html

    Pacific Coast time, 9-5, M-F.

  6. alanft
    Member
    Posted 5 months ago #

    wonderful thank you. it's always an obvious possibility after the fact. if you are up to it, you can get rid of that extra troubleshooting line, but before it is a line that reads

    if ($widget_area=='wp_inactive_widgets') next;

    try changing that to

    if ($widget_area=='wp_inactive_widgets' || empty($widget_list)) next;

  7. David Tierney
    Member
    Posted 5 months ago #

    Made that change but the result is the same message as before.

  8. alanft
    Member
    Posted 5 months ago #

    GAH! and thanks so much for working with me on this.

    ok would you mind reinstating the troubleshooting line, but with a small change to add [END] like this:

    echo "<pre>WIDGET LIST=";print_r($widget_list); echo "[END]</pre>";

    and again let me know what pops up before any errors

  9. alanft
    Member
    Posted 5 months ago #

    (actually i wonder if i can quickly set up an empty sidebar on a test wp install i have...)

  10. alanft
    Member
    Posted 5 months ago #

    no it's not empty arrays. it's that mysterious last WIDGET LIST= where it doesn't then say array - I can't seem to engineer that in my wp instances.

    i guess i could just code to explicitly check it IS an array with at least one key/value…

  11. alanft
    Member
    Posted 5 months ago #

    OMG, no i have done an amazingly foolish thing and got an entire command wrong

    if ($widget_area=='wp_inactive_widgets' || empty($widget_list)) next;

    should be

    if ($widget_area=='wp_inactive_widgets' || empty($widget_list)) continue;

    amazingly dense, sorry. i'm pretty sure that will fix it

  12. alanft
    Member
    Posted 5 months ago #

    I've committed that into ('stable') version 0.51 which is now live too

  13. David Tierney
    Member
    Posted 5 months ago #

    Sorry. Stepped away. Just came back and updated to the latest and the errors are gone. Thanks.

  14. alanft
    Member
    Posted 5 months ago #

    thanks for the prompt feedback - i marked this as resolved.

Reply

You must log in to post.

About this Plugin

About this Topic