Zmiana wersji PHP na 7.0 rozwiązała problem. Oczywiście tylko tymczasowo, bo mam Prestę w wersji 1.6 i stąd problemy z nowym PHP. Czas na upgrade
Edit History
Jeśli chodzi o PHP na serwerze to mam wersję 7.2. Zmieniłem teraz na 7.1
Czekam chwilę i sprawdzę, czy to pomoże
Błąd mówi o "continue" widocznym tu w 3 linijce:
public function drawCustomMenuItem($category, $level = 0, $last = false, $item, $lang_id) {
if ($level > $this->_show_level)
continue;
$cateCurrent = $this->getCurrentCategoriesId($lang_id);
$categoryObject = new Category();
$html = array();
$blockHtml = '';
$id_shop = (int) Context::getContext()->shop->id;
$id = $category;
$blockId = sprintf('pt_menu_idcat_%d', $id);
$staticBlock = $this->getStaticBlockContent($blockId);
$blockIdRight = sprintf('pt_menu_idcat_%d_right', $id);
$staticBlockRight = $this->getStaticBlockContent($blockIdRight);
// --- Static Block ---
$blockHtml = $staticBlock;
/* check block right */
$blockHtmlRight = $staticBlockRight;
if ($blockHtmlRight)
$blockHtml = $blockHtmlRight;
// --- Sub Categories ---
$activeChildren = $categoryObject->getChildren($category, $lang_id);
$activeChildren = $this->getCategoryByLevelMax($activeChildren);
// --- class for active category ---
$active = '';
if (isset($cateCurrent[0]) && in_array($category, array($cateCurrent[0])))
$active = ' act';
// --- Popup functions for show ---
$drawPopup = ($blockHtml || count($activeChildren));
if ($drawPopup) {
$html[] = '<div id="pt_menu' . $id . '" class="pt_menu' . $active . ' nav-' . $item . '">';
} else {
$html[] = '<div id="pt_menu' . $id . '" class="pt_menu' . $active . ' nav-' . $item . ' pt_menu_no_child">';
}
//echo $category;
//$cate = new Category((int) $category);
$id_lang = (int)Context::getContext()->language->id;
$cate = new Category((int)$category,$id_lang,$id_shop);
//$link = $categoryObject->getLinkRewrite($category, $lang_id);
$parameters = "";
$link = Context::getContext()->link->getCategoryLink((int) $category, null, null, ltrim($parameters, '/'));
// --- Top Menu Item ---
$html[] = '<div class="parentMenu">';
$html[] = '<a href="' . $link . '">';
$name = strip_tags($cate->name);
$name = str_replace(' ', ' ', $name);
$name = $this->l($name);
$html[] = '<span>' . $name . '</span>';
if ($drawPopup) {$html[] = '<i class="icon-caret-down"></i>';}
$html[] = '</a>';
$html[] = '</div>';
// --- Add Popup block (hidden) ---
if ($drawPopup) {
if ($this->_show_level > 2) {
// --- Popup function for hide ---
$html[] = '<div id="popup' . $id . '" class="popup" style="display: none; width: 1228px;">';
// --- draw Sub Categories ---
if (count($activeChildren) || $blockHtml) {
$html[] = '<div class="block1" id="block1' . $id . '">';
$html[] = $this->drawColumns($activeChildren, $id, $lang_id);
if ($blockHtml && $blockHtmlRight) {
$html[] = '<div class="column blockright">';
$html[] = $blockHtml;
$html[] = '</div>';
}
$html[] = '<div class="clearBoth"></div>';
$html[] = '</div>';
}
// --- draw Custom User Block ---
if ($blockHtml && !$blockHtmlRight) {
$html[] = '<div class="block2" id="block2' . $id . '">';
$html[] = $blockHtml;
$html[] = '</div>';
}
$html[] = '</div>';
}
}
$html[] = '</div>';
$html = implode("\n", $html);
return $html;
}
Jeśli chodzi o PHP na serwerze, to muszę sprawdzić... gdzie to się sprawdza. Ale poszukam i wrócę tu z odpowiedzią. Szczerze mówiąc, moja niewielka wiedza w tym temacie od razu pokierowała mnie w strone właśnie wersji PHP, ale jeszcze nie sprawdziłem co w tym temacie się dzieje.
Błąd mówi o "continue" widocznym tu w 3 linijce:
public function drawCustomMenuItem($category, $level = 0, $last = false, $item, $lang_id) {
if ($level > $this->_show_level)
continue;
$cateCurrent = $this->getCurrentCategoriesId($lang_id);
$categoryObject = new Category();
$html = array();
$blockHtml = '';
$id_shop = (int) Context::getContext()->shop->id;
$id = $category;
$blockId = sprintf('pt_menu_idcat_%d', $id);
$staticBlock = $this->getStaticBlockContent($blockId);
$blockIdRight = sprintf('pt_menu_idcat_%d_right', $id);
$staticBlockRight = $this->getStaticBlockContent($blockIdRight);
// --- Static Block ---
$blockHtml = $staticBlock;
/* check block right */
$blockHtmlRight = $staticBlockRight;
if ($blockHtmlRight)
$blockHtml = $blockHtmlRight;
// --- Sub Categories ---
$activeChildren = $categoryObject->getChildren($category, $lang_id);
$activeChildren = $this->getCategoryByLevelMax($activeChildren);
// --- class for active category ---
$active = '';
if (isset($cateCurrent[0]) && in_array($category, array($cateCurrent[0])))
$active = ' act';
// --- Popup functions for show ---
$drawPopup = ($blockHtml || count($activeChildren));
if ($drawPopup) {
$html[] = '<div id="pt_menu' . $id . '" class="pt_menu' . $active . ' nav-' . $item . '">';
} else {
$html[] = '<div id="pt_menu' . $id . '" class="pt_menu' . $active . ' nav-' . $item . ' pt_menu_no_child">';
}
//echo $category;
//$cate = new Category((int) $category);
$id_lang = (int)Context::getContext()->language->id;
$cate = new Category((int)$category,$id_lang,$id_shop);
//$link = $categoryObject->getLinkRewrite($category, $lang_id);
$parameters = "";
$link = Context::getContext()->link->getCategoryLink((int) $category, null, null, ltrim($parameters, '/'));
// --- Top Menu Item ---
$html[] = '<div class="parentMenu">';
$html[] = '<a href="' . $link . '">';
$name = strip_tags($cate->name);
$name = str_replace(' ', ' ', $name);
$name = $this->l($name);
$html[] = '<span>' . $name . '</span>';
if ($drawPopup) {$html[] = '<i class="icon-caret-down"></i>';}
$html[] = '</a>';
$html[] = '</div>';
// --- Add Popup block (hidden) ---
if ($drawPopup) {
if ($this->_show_level > 2) {
// --- Popup function for hide ---
$html[] = '<div id="popup' . $id . '" class="popup" style="display: none; width: 1228px;">';
// --- draw Sub Categories ---
if (count($activeChildren) || $blockHtml) {
$html[] = '<div class="block1" id="block1' . $id . '">';
$html[] = $this->drawColumns($activeChildren, $id, $lang_id);
if ($blockHtml && $blockHtmlRight) {
$html[] = '<div class="column blockright">';
$html[] = $blockHtml;
$html[] = '</div>';
}
$html[] = '<div class="clearBoth"></div>';
$html[] = '</div>';
}
// --- draw Custom User Block ---
if ($blockHtml && !$blockHtmlRight) {
$html[] = '<div class="block2" id="block2' . $id . '">';
$html[] = $blockHtml;
$html[] = '</div>';
}
$html[] = '</div>';
}
}
$html[] = '</div>';
$html = implode("\n", $html);
return $html;
}