WordPress.org

Ready to get started?Download WordPress

Forums

Gecka Submenu
Warning (7 posts)

  1. Marco Chiesi
    Member
    Posted 1 year ago #

    Hi there,
    I am using plugin 0.7-beta4 on WP 3.5.

    I get the following error on a menu widget which uses "Current page's top parent" as starting menu:

    Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/wp-content/plugins/gecka-submenu/models/NavMenuHacks.php on line 94

    I fixed this by myself, hacking the plugin source code, by adding a check like if (is_array($items)), but I hope it will be fixed in next releases.

    Thank you!

    http://wordpress.org/extend/plugins/gecka-submenu/

  2. Marco Chiesi
    Member
    Posted 1 year ago #

    P.s. there was a similar problem also around line 65:

    Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/wp-content/plugins/gecka-submenu/models/NavMenuHacks.php on line 65

  3. bryanjlaz
    Member
    Posted 1 year ago #

    Marco,

    I have the same issues on line 94 & 65.

    I am new with php. Can you explain how/where to add this code?

    I have added... if (is_array($items)) .... at line 64, then took out and tried 66, then replaced 65 with it and nothin.. lol..
    Don't laugh, just throwing darts..

    Thanks..

    Bryan

  4. alejandrofm
    Member
    Posted 1 year ago #

    Line 94 solve with: if (is_array($items)) foreach($items as $item) {

    Line 65 continue the problem: if (is_array($items)) foreach($posts as $key=>$post) {

    have you any idea to solve it?

    Thanks!

  5. Marco Chiesi
    Member
    Posted 1 year ago #

    Here's the code to fix the issue:

    1. File NavMenuHacks.php on line 65.

    Change
    foreach($posts as $key=>$post) {
    to
    if (is_array($posts)) foreach($posts as $key=>$post) {

    2. File NavMenuHacks.php on line 94.

    Change
    foreach($items as $item) {
    to
    if (is_array($items)) foreach($items as $item) {

    Note: the array names are different in the two cases.

  6. alejandrofm
    Member
    Posted 1 year ago #

    Yeeeeeeah, thanks you very much Marco... now work well.

  7. Samantha Miller
    Member
    Posted 11 months ago #

    Thank you very much Marco, this solves it for me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.