2 added 382 characters in body
source | link

We have a strange error. When an extension is installed (adds href-lang to head) then menu header is empty (no menu aruments).

Extension on: renderCategoriesMenuHtml returns ""

Extension off: renderCategoriesMenuHtml returns "menu item1; menu item 2 etc"

My conclusion is that $this object might be changed/lost. How can we debug this?


** Function called in top.phtml to generate menubar

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>

** File/function in core catalog/block/navigation

public function renderCategoriesMenuHtml($level = 0, $outermostItemClass = '', $childrenWrapClass = '')
{
    $activeCategories = array();
    foreach ($this->getStoreCategories() as $child) {
        if ($child->getIsActive()) {
            $activeCategories[] = $child;
        }
    }
    $activeCategoriesCount = count($activeCategories);
    $hasActiveCategoriesCount = ($activeCategoriesCount > 0);

    if (!$hasActiveCategoriesCount) {
        return 'Goes wrong here when extension is activated';
    }

Part of extension block rewrite: construct ok? extend ok?

class Module_HrefLang_Block_Head extends Mage_Core_Block_Template {

    protected function _construct() {
        parent::_construct();   
    }

    public function getAlternateUrls() {
        return $this->helper('alternatelang')->getAlternateUrls();
    }

}

We have a strange error. When an extension is installed (adds href-lang to head) then menu header is empty (no menu aruments).

Extension on: renderCategoriesMenuHtml returns ""

Extension off: renderCategoriesMenuHtml returns "menu item1; menu item 2 etc"

My conclusion is that $this object might be changed/lost. How can we debug this?


** Function called in top.phtml to generate menubar

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>

** File/function in core catalog/block/navigation

public function renderCategoriesMenuHtml($level = 0, $outermostItemClass = '', $childrenWrapClass = '')
{
    $activeCategories = array();
    foreach ($this->getStoreCategories() as $child) {
        if ($child->getIsActive()) {
            $activeCategories[] = $child;
        }
    }
    $activeCategoriesCount = count($activeCategories);
    $hasActiveCategoriesCount = ($activeCategoriesCount > 0);

    if (!$hasActiveCategoriesCount) {
        return 'Goes wrong here when extension is activated';
    }

We have a strange error. When an extension is installed (adds href-lang to head) then menu header is empty (no menu aruments).

Extension on: renderCategoriesMenuHtml returns ""

Extension off: renderCategoriesMenuHtml returns "menu item1; menu item 2 etc"

My conclusion is that $this object might be changed/lost. How can we debug this?


** Function called in top.phtml to generate menubar

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>

** File/function in core catalog/block/navigation

public function renderCategoriesMenuHtml($level = 0, $outermostItemClass = '', $childrenWrapClass = '')
{
    $activeCategories = array();
    foreach ($this->getStoreCategories() as $child) {
        if ($child->getIsActive()) {
            $activeCategories[] = $child;
        }
    }
    $activeCategoriesCount = count($activeCategories);
    $hasActiveCategoriesCount = ($activeCategoriesCount > 0);

    if (!$hasActiveCategoriesCount) {
        return 'Goes wrong here when extension is activated';
    }

Part of extension block rewrite: construct ok? extend ok?

class Module_HrefLang_Block_Head extends Mage_Core_Block_Template {

    protected function _construct() {
        parent::_construct();   
    }

    public function getAlternateUrls() {
        return $this->helper('alternatelang')->getAlternateUrls();
    }

}
1
source | link

debugging: renderCategoriesMenuHtml returning empty

We have a strange error. When an extension is installed (adds href-lang to head) then menu header is empty (no menu aruments).

Extension on: renderCategoriesMenuHtml returns ""

Extension off: renderCategoriesMenuHtml returns "menu item1; menu item 2 etc"

My conclusion is that $this object might be changed/lost. How can we debug this?


** Function called in top.phtml to generate menubar

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>

** File/function in core catalog/block/navigation

public function renderCategoriesMenuHtml($level = 0, $outermostItemClass = '', $childrenWrapClass = '')
{
    $activeCategories = array();
    foreach ($this->getStoreCategories() as $child) {
        if ($child->getIsActive()) {
            $activeCategories[] = $child;
        }
    }
    $activeCategoriesCount = count($activeCategories);
    $hasActiveCategoriesCount = ($activeCategoriesCount > 0);

    if (!$hasActiveCategoriesCount) {
        return 'Goes wrong here when extension is activated';
    }