Warning: Invalid argument supplied for foreach() - view.html.php on line 161

Started by hesicos, 14 February 2020, 12:25:23

Previous topic - Next topic
A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

hesicos

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!  :)

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

hesicos

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