Then i using page title not work

afanasiev.av - October 27, 2009 - 15:29
Project:Node breadcrumb
Version:6.x-1.0-beta6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi, sorry for my English.

I found error. then i using node breadcrumb page title not work. Page title use only default token.

#1

edhel - October 27, 2009 - 16:39

Do you mean problem with combination pathautho and node breadcrumb modules?

#2

afanasiev.av - October 28, 2009 - 04:48

No.

If i add rules for content type "xxxx" and attach it to menu item "yyyy", then page title work bad.

I found error in this code (page title):
// Node (either node or comment reply)
if ((arg(0) == 'node' && is_numeric(arg(1))) || (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2)) && module_exists('comment')) ) {
$types['node'] = menu_get_object();
$page_title_pattern = variable_get('page_title_type_'. $types['node']->type, '');
}

menu_get_object() - return NULL

#3

edhel - October 28, 2009 - 14:31

write this in russian)

напиши по-русски, я нихера не понял)

#4

afanasiev.av - October 30, 2009 - 04:52

:D

Как выловить ошибку:
Создаём тип контента "магазин". Создаём меню "Магазин". С помощью node breadcrumb привязываем тип контента "магазин" к меню "магазин". Создаём правило создания заголовка page title для типа контента "магазин". Создаём новый нод "магазин". Смотрим заголовок - он не правильный. Применилось правило по умолчанию page title.

Ошибка происходит в этом коде модуля page title:
// Node (either node or comment reply)
if ((arg(0) == 'node' && is_numeric(arg(1))) || (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2)) && module_exists('comment')) ) {
$types['node'] = menu_get_object();
$page_title_pattern = variable_get('page_title_type_'. $types['node']->type, '');
}

menu_get_object() - return NULL

Вот...

#5

edhel - October 30, 2009 - 14:10

Во, про модуль page_title надо было сразу и писать.

Могу только предложить чуток пофиксить page_title.module. Заменить в функции page_title_page_get_title() строчку:

$types['node'] = menu_get_object();

на:

$types['node'] = is_numeric(arg(1)) ? node_load(arg(1)) : menu_get_object();

Это же по-английски, может кому-нибудь пригодится.

---------------- In english ----------------

You can make small fix in page_title.module file. Change at page_title_page_get_title() function line:

$types['node'] = menu_get_object();

to:

$types['node'] = is_numeric(arg(1)) ? node_load(arg(1)) : menu_get_object();

 
 

Drupal is a registered trademark of Dries Buytaert.