Vox Populi(x) forum

Alexandria Book Library => Errori (Bugs) => Topic started by: hesicos on 14 February 2020, 12:25:23

Title: Warning: Invalid argument supplied for foreach() - view.html.php on line 161
Post by: hesicos on 14 February 2020, 12:25:23
Hello!
I am very excited about this software, it is very good, however I am getting an error message:

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


        $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!  :)
Title: Re: Warning: Invalid argument supplied for foreach() - view.html.php on line 161
Post by: hesicos on 14 February 2020, 12:45:02
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