Author Topic: Warning: Invalid argument supplied for foreach() - view.html.php on line 161  (Read 168 times)

Offline hesicos

  • Coccinella
  • *
  • Posts: 2
  • Karma: +0/-0
Hello!
I am very excited about this software, it is very good, however I am getting an error message:

Quote
Warning: Invalid argument supplied for foreach() in /home/aecc/www/components/com_abook/views/category/view.html.php on line 161

Code: [Select]
        $this->params->set('page_subheading', $this->category->title);
$category = $this->category->getParent();
line 161 -->    foreach ($this->path as $item){
                                        $pathway->addItem($item['title'], $item['link']);
                        }
}

This happened after I created the "ebooks" category.
Can someone help me? I am not a php programmer.
I am using Joomla 3.9.15 and PHP 7.3.
Thank you in advance!  :)

Offline hesicos

  • Coccinella
  • *
  • Posts: 2
  • Karma: +0/-0
Hello all.

I have already solved the problem by adding the code below in bold.

if( is_array($this) )   {   
   
         foreach ($this->path as $item){
                                        $pathway->addItem($item['title'], $item['link']);
                        }
      }
      }

Thanks!   :D