my drupal installation locates in

http://localhost/dirname/

First homepage link hrefs to http://localhost/dirname//dirname/

russian:
Привет (: Спасибо большое за модуль, действительно крут. Но вот такая проблема, если папка с друпалом лежит не в корне сервера, а в папке dirname, то в хлебных крошках ссылка, которая должна вести на главную, ведёт на http://localhost/dirname//dirname/

Пробовал переписать в .htaccess
Rewriterule /dirname
но безрезультатно.

Даже когда отключаю принудительный вывод главной и вывожу руками первой ссылкой
<front>
то результат тот же самый.

UPD: Когда использую стандартный рендерер хлебных крошек - всё работает, но не работает замена разделителя ):

Comments

spleshka’s picture

Hi,
I think this is not a module bug. Open your settings.php and provide there correct $base_url.

russian:
Проблема не в модуле. Открой settings.php и укажи там правильный $base_url, после чего сбрось кэш.

alexander_danilenko’s picture

tryed to set $base_url to
http://localhost/dirname
but it was not resolved problem. tryed to set

http://site.ru/asd
but in breadcrumb home link hrefs to
http://site.ru/asd//asd/
maybe bug in module?

russian:
Попробовал поправить $base_url на
http://localhost/dirname
но проблемы не решило. попробовал заменить на
http://site.ru/asd
но ссылка в хлебных крошках всё ровно ведёт на
http://site.ru/asd//asd/
Может всё таки баг в модуле? (:

spleshka’s picture

I digged deeper - you right, this is module bug.. OK, I will search for a solution.

russian:
Да, взглянул более внимательно - действительно в модуле. Буду искать решение, там довольно неоднозначный баг.

kalabro’s picture

Can't reproduce on latest dev

spleshka’s picture

I think that bug is still exists even in the latest dev. See line 250 in path_breadcrumbs.module.

kalabro’s picture

Hmm.. l() called twice.

diff --git a/path_breadcrumbs.module b/path_breadcrumbs.module
index 6ea51e4..3ab4da8 100644
--- a/path_breadcrumbs.module
+++ b/path_breadcrumbs.module
@@ -255,9 +255,15 @@ function path_breadcrumbs_breadcrumb($variables) {
         if ($snippet == PATH_BREADCRUMBS_RICH_SNIPPETS_MICRODATA) {
           $title = '<span itemprop="title">' . $title . '</span>';
         }
-
+        $props = array();
+        foreach ($options['attributes'] as $prop => $value) {
+          $props_str = ' ';
+          $props[] = $prop . '=' . '"' . $value . '"';
+        }
+        $props_str .= implode(' ', $props);
         // Build new text or link breadcrumb.
-        $new_breadcrumb = $href ? l($title, $href, $options) : $title;
+        $new_breadcrumb = $href ? '<a href="' . $href . '"'.$props_str.'>' . $title . '</a>' : $title;
       }
       else {
         // If no rich snippets support do not process breadcrumb.

spleshka’s picture

No, l() called once. But if $href contains URL like /dirname/node/1 preg_match() will get this url and then this URL will be provided to l() again. So I see problem in preg_match().

kalabro’s picture

l() adds $base_url to href automatically here. We are parsing it and calling l() a second time, so we have 2 $base_url's in href.

spleshka’s picture

Exactly. But I have to parse link because I should provide rich snippers for all breadcrumbs (even if they were generated not by my module). But I hope that I found a solution: see hook_menu_breadcrumb_alter(). I hope that I able to change current theming function to this one and remove preg_match() at all.

kalabro’s picture

If you succeed, it will be more flexible. I will follow anyway :)

spleshka’s picture

Unfortunately I am wrong, see drupal_get_breadcrumb: menu_get_active_breadcrumb() called only if there are no breadcrumbs on the page... So we still have to search for a better solution.

kalabro’s picture

I think, #6 can be temporary fix for someone

spleshka’s picture

yep. It is good as temporary but not as permanent solution.

spleshka’s picture

Status: Active » Closed (fixed)

Permanent solution found. Commited at e6738bd. Thanks all for your time.