• Resolved polis01

    (@polis01)


    I am getting an error reported to the top of my dashboard: “supplied for foreach() in /home/c119123472/public_html/wp-content/plugins/google-maps-widget/gmw-tracking.php on line 157”

    Can you help? I have reinstalled the plugin with no luck.

    Looking near line 157 I see this below, with line 157 beginning with “for each”:

    // counts the number of active GMW widgets in sidebars
      static function count_active_widgets() {
        $count = 0;
    
        $sidebars = get_option('sidebars_widgets', array());
        foreach ($sidebars as $sidebar_name => $widgets) {
          if (strpos($sidebar_name, 'inactive') !== false || strpos($sidebar_name, 'orphaned') !== false) {
            continue;
          }
          if (is_array($widgets)) {
            foreach ($widgets as $widget_name) {
              if (strpos($widget_name, 'googlemapswidget') !== false) {
                $count++;
              }
            }
          }
        } // foreach sidebar
Viewing 4 replies - 1 through 4 (of 4 total)
  • We’ll recheck that loop, bugs can always creep in πŸ™ Sorry.
    Do you actually have any widgets on that site? GMW or not …

    Thread Starter polis01

    (@polis01)

    I have resolved this. It seems that post-migration the default widgets in the sidebar did not populate on the new website, I placed the widgets I had populated in development in production in the same order and the error went away. Thank you for your speedy reply!

    You’re welcome! Glad you got it fixed. Still, we obviously have a bug πŸ™‚

    Thread Starter polis01

    (@polis01)

    Glad I could help then too! Thanks for a great product!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Line 157 Error’ is closed to new replies.