WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] Php Warning (3 posts)

  1. Benoist
    Member
    Posted 2 years ago #

    I have this : [04-May-2012 22:38:39 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/nono/public_html/wp-content/plugins/yet-another-related-posts-plugin/class-cache.php on line 169

    line 169 is :
    foreach ( $weight['tax'] as $tax => $weight ) {

    Have you an idea ?

    Regards

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. jwolfe-pgoa
    Member
    Posted 2 years ago #

    I also noticed that today when I installed it. I changed the code around that statement to:

    // Build tax criteria query parts based on the weights
                    if ( is_array($weight['tax']) ) {
                    foreach ( $weight['tax'] as $tax => $weight ) {
                            $newsql .= " + " .$this->tax_criteria($reference_ID, $tax) . " * " . intval($weight);
                    }
                    }

    Just to check if $weight['tax'] is an array before going into that loop.

  3. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    I believe this is fixed in the latest dev build. Please let me know if it has not. Thanks!

    http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.zip

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic