Prestashop Version: 1.6.16
PHP Version: PHP 7.0.18-0ubuntu0.16.04.1
When I call the product list or a product comes following error message:
Undefined offset: 1 in classes/controller/AdminController.php on line 1528
Here is the prosses overview with comments.
public function initToolbarTitle()
{
// $this->breadcrumbs == array(0 => 'Produkte', 1 => 'Produkte')
$this->toolbar_title = is_array($this->breadcrumbs) ? array_unique($this->breadcrumbs) : array($this->breadcrumbs);
// The array index now is on 2
// $this->toolbar_title == array(0 => 'Produkte')
switch ($this->display) {
case 'edit':
$this->toolbar_title[] = $this->l('Edit', null, null, false);
// Now there is a gap in the array elements
// $this->breadcrumbs == array(0 => 'Produkte', 2 => 'Bearbeiten')
$this->addMetaTitle($this->l('Edit', null, null, false));
break;
}
}
public function initPageHeaderToolbar()
{
case 'edit':
// Here we jump into the hole of the lost array element
$this->addMetaTitle($this->toolbar_title[count($this->toolbar_title) - 1]);
}
The same effect do you have with this example code
$toolbar_title = array_unique(array(0 => 'Produkte', 1 => 'Produkte'));
$toolbar_title[] = 'Bearbeiten';
//array(0 => 'Produkte', 2 => 'Bearbeiten')
var_dump($toolbar_title);
That is not a feature, but a Bug.