?
avatar Robdebert
Robdebert
4 Nov 2014

Solution to this: See bottom.

Steps to reproduce the issue

create a new joomla 3.3.3 (or higher) page, add some languages (de, en, nl for example) and create a module for the breadcrumbs.
Set a default menu-item (home) for every language and some other ones with submenu-items, to test breadcrumb.

Siehe auch: http://www.joomlaportal.de/joomla-3-x-allgemeine-fragen/314773-breadcrumb-ist-auf-unterseiten-leer-evtl-wegen-mehrsprachigkeit.html#post1562329

Expected result

Breadcrumb should display the menuitems in the breacrumb as pathway like in one-language-sites.

Actual result

only "you are here" is displayed, because jpathwaysite does not return anything.

System information (as much as possible)

Joomla 3.3 and 3.3.6

Additional comments

It can be tested when adding this code into the index.php of a template on the very top:

$app = JFactory::getApplication();
$pathway = $app->getPathway();
$items = $pathway->getPathWay();
print_r($pathway); print_r($items); die();

It only outputs an empty array.

Here's my solution:

open the file: /libraries/cms/pathway/site.php

At line 40 there is this code:

$menus = $menu->getMenu();
$home = $menu->getDefault();
if (is_object($home) && ($item->id != $home->id)) {
...

I changed this code to the following:

$menus = $menu->getMenu();
$home = $menu->getDefault();

// Startpage of multilanguage-pages.
if (empty($home)) {
$lang = JFactory::getLanguage();
$lang_tag = $lang->getTag();
$home = $menu->getDefault($lang_tag);
}
if (is_object($home) && ($item->id != $home->id)) {
...

avatar Robdebert Robdebert - open - 4 Nov 2014
avatar Bakual
Bakual - comment - 4 Nov 2014

Can you create a Pull Request with your solution? See http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests for how to do it.

If we have a PR, then it can be tested.

avatar infograf768
infograf768 - comment - 4 Nov 2014

I can't reproduce this issue. Here the breadcrumb displays Ok
screen shot 2014-11-04 at 17 53 06

avatar infograf768
infograf768 - comment - 4 Nov 2014

The reason is that $home is never empty in a multilanguage site, as a menu with a menu item set to ALL languages should always exist and not displayed.

avatar infograf768
infograf768 - comment - 4 Nov 2014

Therefore, if we really needed to check home we would do

            $menus = $menu->getMenu();
            $home  = $menu->getDefault();
            $lang = JFactory::getLanguage();
            $lang_tag = $lang->getTag();
            $home = $menu->getDefault($lang_tag);

            if ($home->language == '*' && JLanguageMultilang::isEnabled())
            {
                $home = $menu->getDefault($lang_tag);
            }

Not sure it is necessary

avatar richard67
richard67 - comment - 4 Nov 2014

I also cannot reproduce here (www.richard-fath.de).

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4988.

avatar zero-24 zero-24 - close - 5 Nov 2014
avatar infograf768
infograf768 - comment - 5 Nov 2014

Please test patch.
#4994

avatar infograf768 infograf768 - close - 5 Nov 2014
avatar infograf768 infograf768 - change - 5 Nov 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-11-05 08:37:13
avatar infograf768 infograf768 - change - 5 Nov 2014
Priority Urgent Medium
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment